View Single Post
Old 02-13-2008, 01:41 PM   #4 (permalink)
webosb
The Contributor
 
webosb's Avatar
 
Join Date: Nov 2007
Posts: 35
Thanks: 21
webosb is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
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

I had to change it a lil bit to:

WHERE sup_date <= UNIX_TIMESTAMP(NOW())
AND sup_date >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 30 DAY))

but it works great Salathe. much thanks. you've been very helpful
__________________
one outstanding employee does more and costs less than two adequate performers.
webosb is offline  
Reply With Quote