Genius123
asked on
Access Query with Time function
Hello,
In my query, I'm trying to put this in the criteria but getting errors with my syntax. No matter the date, I'm just trying to set a time range.
TimeValue([WhateverDate]) > 4:30 PM and TimeValue([WhateverDate]) < 12:00 AM
Thanks,
Joel
In my query, I'm trying to put this in the criteria but getting errors with my syntax. No matter the date, I'm just trying to set a time range.
TimeValue([WhateverDate]) > 4:30 PM and TimeValue([WhateverDate]) < 12:00 AM
Thanks,
Joel
ASKER
With that, I'm getting a Data type mismatch error. But I know my [WhateverDate] field is a DateTime field, so I'm not sure why I'm getting the error....
I assume your whateverdate is not a field name so:
TimeValue(#2015-10-02 05:30:00 PM#) > #4:30 PM# and TimeValue(#2015-10-02 10:00:00 PM#) < #12:00 AM#
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked, thank you very much.
Try
TimeValue([WhateverDate]) > #4:30 PM# and TimeValue([WhateverDate]) < #12:00 AM#
OM Gang