How do I separate a date/time stamp in Access 2007? I need to be able to query for certain times of day over a period of 120 days (i.e. create a query that only gives me the data for 1pm, irrespective of the date). Any suggestions?
date/time stamp
Collapse
X
-
In VBA code:
DatePart("h",Da teTimeField)
Or in a Query:
DatePart("h",[DateTimeField])
will retrieve the hour.
The general syntax is
DatePart("Inter val",DateTimeFi eld)
To retrieve other components, use these as the Interval
yyyy Year
q Quarter
m Month
y Day of year
d Day of Month
w Weekday
ww Week
h Hour
n Minute
s Second
Comment