Date/Time group by 2 hr increments.

S

Snickers

I have a date/time field issue. I would like to get a count of daily records
updated in 2 hour increments sorted by user.
I'm very new to access, I appreciate any help.

Thanks.
 
J

John Spencer

Does the dateTime field contain both Dates and Times? Or Just Times?

Hour([YourField]) \2 will give you twelve two-hour periods - numbers 0 to 11
If you want 1, 3, 5 , ... then
(Hour([YourField]) \2) * 2 + 1
If you want 0,2,4 ... then drop the plus 1.

You can get just the date portion by using DateValue(YourField)

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

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

Top