I want to count the number of items that occur within a range of time throughout different days.
My original data comes from a machine that logs the time a car passes a point in a road over different days (Traffic Analysis).
I'd like to create a query that would count the number of cars between certain time periods, i.e from 7 to 10, 10 to 14:00 and 14:00 to 21:00 (military time).
Currently the date field is displayed as such
(23.08.2010 10:37:20)
(day, month, year, hour, minute, second)
I have created a seperate table named Data_Range with a the following Columns: Start_Time, End_Time, ID
It would be nice if I could write a query or VB script that would look at the time ranges specified in Data_Range and then give me the resulting count for items within that time range regardless of date.
I'm not sure of the exact SQL syntax but I envision it to be something like this:
SELECT Time from TrafficDataTable, Count* as Number_of_cars WHERE Time_1 is between Start_time and End_Time
Thanks
Miguel