Date from DateTime field

bbulla

I'd rather be golfing
Local time
Today, 01:48
Joined
Feb 11, 2005
Messages
101
Hi,

I have a field in a table that holds the Date/Time. I am trying to create a WHERE clause so that I can get all the records between two dates. This is what I currently have, but no luck:

DoCmd.OpenReport "rptSummerReport", acViewPreview, , "SEASON = 'SUMMER' AND PATROLDTE BETWEEN #" & calFrom.Value & "# AND #" & calTo.Value & "#", acWindowNormal

This is driving me nuts. Any ideas??

(calFrom and calTo are Calendar controls)
 
Assuming your code is correct, datetime requires you set a date the day after the end date because end date doesn't cover the hours of that day. End date plus 1 covers all the occurrences for the day before.
 

Users who are viewing this thread

Back
Top Bottom