View previous topic :: View next topic
|
Author |
Message |
venkatm99
New User
Joined: 01 Jun 2006 Posts: 23 Location: Sinagpore
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
|