View Single Post
Old 02-13-2008, 12:30 PM   #3 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,324
Thanks: 5
Salathe is on a distinguished road
Default

SQL Code:
SELECT
    DATE_FORMAT(FROM_UNIXTIME(sup_date), '%m-%d-%Y') AS sdate,
    COUNT(id) AS scount
FROM
    users
WHERE
    -- post date must be between NOW and 30 DAYS ago
    sup_date <= NOW()
    AND sup_date >= DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY
    sdate
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
webosb (02-13-2008)