Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grouping by 15 minute intervals

Status
Not open for further replies.

itechC

Programmer
Feb 13, 2003
71
CA
Hello,

I have a table with a date time field which records the time of a sale. i would like to group my report by 15 minute intervals so i can display what 15 time interval we had the most sales. Appreciate the help.
 
This expression in a query should round down to 15 minute intervals
Code:
 Int([TimeOfSale]*96)/96
You could also set a sorting and grouping level field/expression to:
[tt][blue] =Int([TimeOfSale]*96)/96[/blue][/tt]



Duane
Hook'D on Access
MS Access MVP
 
Take the time of day, and multiply the time portion by 96 (the number of 15 minute intervals in the day) - there are dozens of other possible methods you could come up with.
One starting point - tested:
Code:
?int(now() - int(now() ) * 96) + 1

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
(Yeah or what Duane said) [blush]

The + 1 gives you intervals from 1- 96; Duane's gives you 0-95 (essentially the same answer).

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top