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

Finding the date which in n days older to the given date


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
venkatm99

New User


Joined: 01 Jun 2006
Posts: 23
Location: Sinagpore

PostPosted: Wed Nov 15, 2006 10:55 am
Reply with quote

Hi

I need to find the date which in n days older to the given date.

will this sql work

SELECT DATE(DAYS(WS-DATE)-WS-OF-DAYS)
INTO WS-VARIBLE
FROM SYSIBM.SYSDUMMY1;

tnx in advance

cheers

venkat
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Nov 15, 2006 11:10 am
Reply with quote

Quote:
will this sql work

Venkat... Why not to give a try ourselves first...

I dont think you really need to convert DATE to DAYS and then SUBSTRACT and then convert back to DATE.
Try this...
Code:
SELECT WS-DATE - N DAYS
INTO WS-VARIBLE
FROM SYSIBM.SYSDUMMY1;
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts VB to FB - Finding LRECL SYNCSORT 4
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top