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
 
Finding the date which in n days older to the given date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Finding the date which in n days older to the given date
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: 1452
Location: Chicago, IL

PostPosted: Wed Nov 15, 2006 11:10 am    Post subject: Re: Finding the date which in n days older to the given date
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    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 Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts Finding IMS resource blocker after se... Hooman24 IMS DB/DC 1 Wed Aug 16, 2017 9:17 pm

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