I have a table that tracks people coming into our offices at various locations. The important fields are as follows:
ID (auto generated integer)
SignInDate (date/time)
LocationID (integer)
so a typical record would look like:
1 - 12/30/2008 8:00 AM - 75
If each person that comes in is a record, I need to be able to get an average count of people that came into each office within the past 60 minutes, sampling only the past 60 days of data, and grouping the results by office.
I am designing a page that will allows users to compare this historical data the the actual count of customers that came into each office today, so they can see if the customer traffic is light, average, or heavy at each office.
I was looping through each location, and then looping my query through each date of the past 60 days, and that worked, but it was taking quite a while to process. I'm trying to find a more efficient way.
ID (auto generated integer)
SignInDate (date/time)
LocationID (integer)
so a typical record would look like:
1 - 12/30/2008 8:00 AM - 75
If each person that comes in is a record, I need to be able to get an average count of people that came into each office within the past 60 minutes, sampling only the past 60 days of data, and grouping the results by office.
I am designing a page that will allows users to compare this historical data the the actual count of customers that came into each office today, so they can see if the customer traffic is light, average, or heavy at each office.
I was looping through each location, and then looping my query through each date of the past 60 days, and that worked, but it was taking quite a while to process. I'm trying to find a more efficient way.