IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Finding Difference in Days


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Finding and researching jobs All Other Mainframe Topics 0
No new posts VB to FB - Finding LRECL SYNCSORT 4
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts Finding Assembler programs PL/I & Assembler 5
Search our Forums:

Back to Top