Forum Moderators: open

Message Too Old, No Replies

Way out of my knowlegde base.

         

tonynoriega

8:19 pm on Aug 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This query below, counts how many records were entered by each agent, and then just counts a total of how many were entered during the past 7 days... which i assign each a name of either "totalcount" or "weekscount"

HOW...can i use this to also query how many were entered on each of the past 7 days, by each agent....

is that possible?

$sql = 'SELECT nhm_associate, COUNT(nhm_associate) AS totalcount, (SELECT COUNT(*) FROM registration_table WHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= entry_time) AS weekscount FROM registration_table WHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= entry_time GROUP BY nhm_associate';