in a query test on date to see if it falls between two date date?

G

Guest

I have a table that has three dates, lets asay 7/1/2006, and I have to other
dates that crate a date reange, lets say 6/28/2006 and 8/1/2006. I want to
check the first date to see if it fall between the second two dates or not.
if it the answer is yes then give me the answer conflict in a field.

I want top do this checking while running a query.
Can any hwlp?
I have tried IIF and have not been able to get it to work.
If I check on one date it will work, but on a range beween the two dates, NO?
 
A

Arthur

try

SELECT
IIf(date1< ( IIf(date2 > date3, date2, date3)) and
date1 > ( IIf(date2 <= date3, date2, date3) ),"Within","NotWithIn"),
FROM Table5;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top