Forum Moderators: coopster
so i can see how many they entered at any given day for the previous 7 days...
i keep getting errors...any insight is greatly appreciated.
thanks
_____________________________________________________________________
$query = "SELECT agent,COUNT(agent) FROM my_table GROUP BY agent
WHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= entry_time";
Can you elaborate on what kinds of errors you are receiving?
Also, try something like this to see if it helps:
$query = "SELECT agent,COUNT(agent) FROM my_table WHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= entry_time GROUP BY agent";
Now, if i may continue...
What my agents want is to show how many records they entered for the previous 7 days, broken down by each day.
So it would kind of look like this i guess...
Would this involve an Array?
Day 1 2 3 4 5 6 7 ¦ Week
-------------------------------------------
AgentA 1 0 0 0 0 0 1 ¦ 2
AgentB 1 1 1 1 0 0 0 ¦ 4
-----------------------------------¦-------
Total 2 1 1 1 0 0 1 ¦ 6