Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
problem with days in select date command

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
abcd.us786

New User


Joined: 06 Dec 2006
Posts: 5
Location: India

PostPosted: Wed Jan 03, 2007 5:21 pm    Post subject: problem with days in select date command
Reply with quote

hello!


i put the query

SELECT DAYS(CURRENT DATE) FROM SYSIBM.SYSDUMMY1;

the result was 732679.

if anyone can tell me what that number specifies?
Back to top
View user's profile Send private message

santosh_dorge

New User


Joined: 03 Dec 2006
Posts: 8
Location: Mumbai

PostPosted: Wed Jan 03, 2007 5:49 pm    Post subject:
Reply with quote

HI,
This query would give you the total number of days
since 01/01/0001 upto the current date.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Jan 03, 2007 6:02 pm    Post subject:
Reply with quote

HI there,

Just to add one more point if u give

Code:
SELECT DAY(CURRENT_DATE)
FROM SYSIBM.SYSDUMMY1; 


the result will be the day part of the value, which is an integer between 1 and 31.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Jan 03, 2007 6:17 pm    Post subject:
Reply with quote

Hi Santosh,

Just one correction in ur post

Its from FM

Quote:
The result is 1 more than the number of days from January 1, 0001 to D, where D is the date that would occur if the DATE function were applied to the argument
Back to top
View user's profile Send private message
santosh_dorge

New User


Joined: 03 Dec 2006
Posts: 8
Location: Mumbai

PostPosted: Thu Jan 11, 2007 5:54 pm    Post subject:
Reply with quote

guptae wrote:
Hi Santosh,

Just one correction in ur post

Its from FM

Quote:
The result is 1 more than the number of days from January 1, 0001 to D, where D is the date that would occur if the DATE function were applied to the argument



Thanks for correction Guptae
Back to top
View user's profile Send private message
santosh_dorge

New User


Joined: 03 Dec 2006
Posts: 8
Location: Mumbai

PostPosted: Thu Jan 11, 2007 6:09 pm    Post subject:
Reply with quote

guptae wrote:
Hi Santosh,

Just one correction in ur post

Its from FM

Quote:
The result is 1 more than the number of days from January 1, 0001 to D, where D is the date that would occur if the DATE function were applied to the argument



Thanks for correction Guptae
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts OUTREC with ALter Command scorp_rahul23 DFSORT/ICETOOL 1 Wed Nov 22, 2017 3:10 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Having a problem FTP'ng to the MF pahiker All Other Mainframe Topics 2 Fri Nov 10, 2017 8:20 pm
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us