DianePDavies said:
How do I write the criteria for a field of the type date/time?
I want all records in a given time frame - e.g. from January 5, 8am to
January 7, 2pm
SELECT *
FROM TableName
WHERE FieldName BETWEEN #2006-01-05 8:00 AM# AND #2006-01-07 2:00 PM#
When time is involved a range is always subject to interpretation. When you
say "to January 7, 2pm" do you really mean that a record with exactly 2 PM
should be included and a record 1 second after 2 PM should NOT be included?
If so then the example I gave you would work. If you want record up to but
not including exactly 2 PM then I would use this instead...
SELECT *
FROM TableName
WHERE FieldName >= #2006-01-05 8:00 AM#
AND FieldName < #2006-01-07 2:00 PM#