Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Finding Difference in Days

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Wed Jun 25, 2008 8:49 pm    Post subject: Finding Difference in Days
Reply with quote

Hi ,

One of my requirement is to extract a column which is of data type Date and to compare it with the current date to find the difference in Days , Like for example if the column value is 01.06.2008 and the current date is 02.06.2008 the difference should be one , is there any way that this can be achieved by quering SYSIBM.SYSDUMMY1?

Thamilzan.
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Jun 25, 2008 9:06 pm    Post subject:
Reply with quote

Have you tried searching or looking in the manual?

days(current date) - days(date2)

results will be an integer (s9(9) comp).


Code:
exec sql
set :results = days(current date) - days(date2)
end exec.

You can extract the date column and do the calculation all in one sql statement.
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 Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Finding unreferenced datasets without... Alan Playford JCL & VSAM 5 Tue Jul 12, 2016 9:07 pm
No new posts How to find jobs that are in schedule... anilkumar922 All Other Mainframe Topics 5 Tue Jun 28, 2016 10:01 am
No new posts Finding repetead surnames in differen... blackjack202 DFSORT/ICETOOL 7 Tue Jun 07, 2016 7:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us