Count by range time

termsig

Registered User.
Local time
Today, 23:01
Joined
Jan 21, 2010
Messages
16
Hi,

I'm trying do something in my access but without luck.

I need get the count of visits and qty for specific range time.

In example Visits (count) Qty (count)
16:00-16:59 1 1
17:00-17:59 0 0

Will be appreciate for any help.

Attached the work database.

The file have over 5k records.
 

Attachments

Hi..

You can try "partition" function..


Code:
select 
  partition(hour([time]),0,23,1)
, count(time) 
, count(qty)
from orders
group by partition(hour([time]),0,23,1)
 
What about the situation when we need count not time but unique visits, i dont want count this same visits for this same period of time.
 

Users who are viewing this thread

Back
Top Bottom