Sean Rhudy
asked on
Need help with another simple SQL statement
Hello,
I have another simple question about my sql statement. I am pulling from 2 different tables into this one table. They are joined by date. The tblCountData.InCount is pulling information from a door counter which counts how many people walk through the doorway. Before, there was only one record per day for the number of people. So this formula worked fine. But now, the door counter manufacturer recommends that I pull data for every hour. When I pull the data in, I need to have only one entry per day. How can I accomplish that?
I have another simple question about my sql statement. I am pulling from 2 different tables into this one table. They are joined by date. The tblCountData.InCount is pulling information from a door counter which counts how many people walk through the doorway. Before, there was only one record per day for the number of people. So this formula worked fine. But now, the door counter manufacturer recommends that I pull data for every hour. When I pull the data in, I need to have only one entry per day. How can I accomplish that?
SELECT tblCountData.RecDate, tblCountData.InCount, [cust per day].CountOfSlcustkey, [cust per day].Expr1
FROM tblCountData INNER JOIN [cust per day] ON tblCountData.RecDate=[cust per day].Expr1;
by looking at above Q i didnt understand much so can you post the sample data and the desired result you want?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, that worked. One more quick question. How can I subtract 23 from sum(tblCountData.Incount) only if the value is greater than 0?
SELECT tblCountData.RecDate, sum(tblCountData.Incount) AS trafficcount
FROM tblCountData
GROUP BY tblCountData.RecDate;
SELECT tblCountData.RecDate, sum(tblCountData.Incount) AS trafficcount
FROM tblCountData
GROUP BY tblCountData.RecDate;