Lookup concerning date in between

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Lookup concerning date in between

Post by cosec »

The Condition for my lookup is if my input date is between the start date and end date then to retrieve the start and end date. The end date could have nulls ( to indicate that they do not expire )

My lookup table has a custom SQL like the following ?

WHERE TBL_TEST.TEST_ID=? AND TBL_TEST.EFF_DATE<=? AND TBL_TEST.EXP_DATE > ?


The above does not handle the case if the exp is null ...how do I accomadate that ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You didn't specify a database, so...

Code: Select all

AND (TBL_TEST.EXP_DATE > ? OR TBL_TEST.EXP_DATE IS NULL)
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply