View Single Post
Old 02-13-2008, 02:41 PM   #4 (permalink)
webosb
The Contributor
 
webosb's Avatar
 
Join Date: Nov 2007
Posts: 41
Thanks: 24
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
__________________
"Things you can get access to, you should never memorize." -Albert Einstein
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
webosb is offline  
Reply With Quote