Group By 15 minute intervals???

Help.Chris

Registered User.
Local time
Today, 14:26
Joined
Oct 11, 2000
Messages
43
Hi All,

Does anybody know if it is possible to group by hour then 15 minute intervals in a query.

I have date like this

booked cost
15:47 9/7/03 £79.00
17:13 9/7/03 £114.68

I would ideally like to see totals of the cost, but grouped as

8:00 £125.65
8:15 £49.32
8:30 £87.21

and so on depending on the time against the booked time/date

Does anybody know if this is possible and if so how i can do it.

Thanks for any help in advance.

Chris
 
you could use the following query
Code:
SELECT
  CDate(Format([booked],"Short Date"))+
    (CDate(Format([booked],"Short Time"))*1440\15)*15/1440 AS TimePeriod
, Sum(costs) AS SumOfCosts
FROM YourTable
GROUP BY CDate(Format([booked],"Short Date"))+
  (CDate(Format([booked],"Short Time"))*1440\15)*15/1440
 
Last edited:
Thanks,

That was a great help!!!

Is working now fine.

Chris
 

Users who are viewing this thread

Back
Top Bottom