Date/Time group by 2 hr increments.

  • Thread starter Thread starter Snickers
  • Start date Start date
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.
 
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
 
Back
Top