If you have a record where the start date is after What Day, and the End
Date is before What Day, then that record must be for something that ends
before it starts. We are dealing with time travel here?
Seriously though, your expression could find records for just one day
(since you included =), but if the field contains a time component, it
would still be almost impossible to actually return a record.
Did you mean:
SELECT * FROM MyTable
WHERE [Start_Date] <= [What Day] AND [End_Date] >= [What Day];
BTW, it can also help to declare the parameter, so Access knows it is a
date/time type. Invalid dates are rejected, and Access is less likely to
interpret it wrongly. It's Parameters on the Query menu.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
Ray said:
I use below to search the records in a table. Regardless what day I
input, the result is null. Can someone advise the possible error and fix.
SELECT * FROM MyTable WHERE [Start_Date] >= [What Day] AND [End_Date]
<= [What Day]
Thanks,
Ray