Between dates not working correctly

WineSnob

Not Bright but TENACIOUS
Local time
Yesterday, 23:24
Joined
Aug 9, 2010
Messages
211
I am using
Between [forms]![rptfrmCriteria]![StartDate] And [forms]![rptfrmCriteria]![EndDate] to select records.
This statement does not include the end date.
I have 1 record that should show up using today as the start and end date. It does not. If I use today as the start and tomorrow as the end it does show up.
I tried >= [forms]![rptfrmCriteria]![StartDate] And <= [forms]![rptfrmCriteria]![EndDate] with the same result.
I also tried >= [forms]![rptfrmCriteria]![StartDate] And <= [forms]![rptfrmCriteria]![EndDate]+1 and got too complex error.
Any ideas ???
 
The between should work. My guess is that your data has a time element, which would cause records on the ending date to be missed. You can use DateValue() to isolate the date portion or add a day to the selected end date.
 
You are correct. It does have a time element in the table. I am writing the date in code using Me.datebl = Now().
I changed it to Me.datebl = Format(Now(), "mm/dd/yyyy") and that fixed it.
Thanks
 

Users who are viewing this thread

Back
Top Bottom