Query between dates

eacollie

Registered User.
Local time
Today, 13:30
Joined
May 14, 2011
Messages
159
I have a [StartDate] and[EndDate] and I want to select any records that fall between these two dates. If I select [StartDate] >= date1 and [EndDate] <= date2, I don't get the records that have a start date BEFORE the date1 but occurred during this date range.

How do I write the query for this?

Thank you!
 
If the dates are in text boxes on the form,

Select * from table where forms!myForm!txtDate1 >= [startDate] and forms!myForm!txtDate2 <= [endDate]
 
Thank you. That gives me anything starting after that date. I want to select anything happening BETWEEN those dates.

For example:
[StartDate] = 1/1/2018 and [End Date] = 1/6/2018

If I select anything starting 1/2/2018 I don't get the above included in the result.
 
Thank you jdraw! That's EXACTLY what I was looking for. (And thank you PBaldy). :D
 
You're welcome - Paul Baldy and I are happy to help.
Good luck.
 

Users who are viewing this thread

Back
Top Bottom