Extracting hour

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query that pulls a ton of data that includes a time/date field (ie...12/01/2003 11:59am). What I want to extract is just the hour so that over a date range I can say that between 11am and 12pm X number of items appear. I have tried the format of Hour:format(hh,[TIMEDATEFIELD]) but it still doesn't work. It will return just 11 for 11 O'Clock, but won't count...Access still sees the complete time date field even though it only displays the hour

Does anyone know of another way to do this

Thank
 
Try:
DatePart("h", [timedatefield])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Chris McK said:
I have a query that pulls a ton of data that includes a time/date field
(ie...12/01/2003 11:59am). What I want to extract is just the hour so that
over a date range I can say that between 11am and 12pm X number of items
appear. I have tried the format of Hour:format(hh,[TIMEDATEFIELD]) but it
still doesn't work. It will return just 11 for 11 O'Clock, but won't
count...Access still sees the complete time date field even though it only
displays the hour.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top