Query date/time field for values between yesterday at 15:31 and today at 15:30?
How do I write criteria to query a date/time field for values that fall between yesterday at 15:31 and today at 15:30? Every option I try generates invalid date field, invalid data type or invalid syntax errors.
I've tried:
between "#"+Format(Date()-1,"mm/dd/yyyy")+" 3:31 PM#" and "#"+Format(Date(),"mm/dd/yyyy")+" 3:30 PM#"
between #Format(Date()-1,"mm/dd/yyyy")+" 3:31 PM"# and #Format(Date(),"mm/dd/yyyy")+" 3:30 PM"#
between #Format(Date()-1,"mm/dd/yyyy") 3:31 PM# and #Format(Date(),"mm/dd/yyyy") 3:30 PM#
and other combinations using CDate or CDbl ... anything to try to corerce a date time field. But nothing works.
Any ideas? Somebody else has had to compare between relative dates and times.
|