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 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 How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts finding delayed job/s in OPC jzhardy IBM Tools 0 Mon May 29, 2017 9:04 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm


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