How do I write a "time range" expression to query a field with a "General
Date" format? I want to select records with a specific time range regardless
of date.
A Date/Time field (regardless of the format) is stored as a Double
Float count of days and fractions of a day (times). Therefore the
value stored in the table for 5:45 today is a different value than
that which would have been stored for 5:45 yesterday.
Try using a calculated field:
TimeValue([datetimefield])
and a criterion of
BETWEEN #11:30:00# AND #15:30:00#
the # delimiters indicate a date/time criterion. For a parameter query
use
BETWEEN [Enter start time:] AND [Enter end time:]
and use the Query's Parameters collection to specify that these are
Date/Time parameters.
John W. Vinson[MVP]