Page 1 of 1

Lookup concerning date in between

Posted: Mon Jul 09, 2007 7:10 pm
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 ?

Posted: Mon Jul 09, 2007 9:58 pm
by chulett
You didn't specify a database, so...

Code: Select all

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