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
 

 

Date comparison - current date should be >= effective-dat

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ngilra

New User


Joined: 01 Oct 2005
Posts: 2

PostPosted: Sun Nov 06, 2005 6:03 am    Post subject: Date comparison - current date should be >= effective-dat
Reply with quote

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
View user's profile Send private message

ikumar

New User


Joined: 02 Aug 2005
Posts: 81

PostPosted: Sun Nov 06, 2005 11:21 pm    Post subject: Re: Date comparison - current date should be >= effective
Reply with quote

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
View user's profile Send private message
ngilra

New User


Joined: 01 Oct 2005
Posts: 2

PostPosted: Sun Nov 06, 2005 11:51 pm    Post subject:
Reply with quote

Hi Kumar,

Thanks for the tip!
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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