View previous topic :: View next topic |
Author |
Message |
viswanathan Beginner
Joined: 17 Jan 2006 Posts: 26 Topics: 13
|
Posted: Mon Feb 28, 2011 9:13 am Post subject: To override CURRENT DATE |
|
|
I need to override the current date with the future value (no hard coding) for testing purpose of a Cobol DB2 program.
SELECT A.1, A.2 FROM space.table A
WHERE CURRENT DATE - 180 DAYS > DATE(A.2)
WITH UR
Anyone please help me.
Thanks,
Vishwa |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Feb 28, 2011 10:15 am Post subject: |
|
|
well
Code: |
CURRENT DATE - 180 DAYS
|
is not a future date.
and what datatype(ddl definition)/value of A.2 ?
what problems are you having? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12382 Topics: 75 Location: San Jose
|
Posted: Mon Feb 28, 2011 11:25 am Post subject: |
|
|
viswanathan,
Change the Current date field to a Host variable and then pass what ever date you want
Code: |
SELECT A.1
,A.2
FROM space.table A
WHERE DATE(:HCOL_DATE - 180 DAYS > DATE(A.2)
WITH UR
|
Once you are done testing remove the Host variable and replace it with current date |
|
Back to top |
|
 |
|
|