View Single Post
Old 02-13-2008, 04:44 AM   #1 (permalink)
webosb
The Contributor
 
webosb's Avatar
 
Join Date: Nov 2007
Posts: 41
Thanks: 24
webosb is on a distinguished road
Default unix timestamps and group by

OK, i'm having trouble with a query that I hope someone can help me with...

I have a table that stores signup dates in unix timestamp format and I'm having problems trying to output data in this way:

date | signups
02-01-2008 | 5
02-02-2008 | 50
02-03-2008 | 10
02-04-2008 | 20
02-05-2008 | 25


SELECT sup_date, COUNT(id) FROM users WHERE sup_date > "1199145600" AND sup_date < "1202774400" GROUP BY sup_date

is there a way to convert the timestamps to output dates???

my goal is to be able to query the amount of signups for each day for the past 30 days - maybe i'm going about it wrong..
__________________
"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