View previous topic :: View next topic
|
Author |
Message |
ngilra
New User
Joined: 01 Oct 2005 Posts: 2
|
|
|
|
Hi Friends,
I have to compare current date with two dates which are defined in my DB2 table.
There are two dates with datanames, 'effective-date' and 'exp-date' in the Db2 table, I have to select record meeting some criteria and the condition for the current date should be >= effective-date and <= exp-date.
The format of effective-date and exp-date is mm-dd-yyyy.
I will appreciate if you help me in giving the suitable code.
Thanks in advance |
|
Back to top |
|
|
ikumar
New User
Joined: 02 Aug 2005 Posts: 81
|
|
|
|
get the current date using,
EXEC SQL SET CURRENTDATE = :ws-currentdate END-EXEC.
in your sql, where clause is like,
WHERE :ws-currentdate BETWEEN EFFECTIVE-DATE and EXP-DATE
Hope this helps...
Thanks,
Kumar. |
|
Back to top |
|
|
ngilra
New User
Joined: 01 Oct 2005 Posts: 2
|
|
|
|
Hi Kumar,
Thanks for the tip! |
|
Back to top |
|
|
|