Forum Moderators: open

Message Too Old, No Replies

MySQL query question.

         

cdmn

7:10 pm on Apr 13, 2007 (gmt 0)

10+ Year Member



Hi there,

i have a table with "timestamp" field and a "bytes send" field.
Im not good with date function in MySQL so please help me if you can :-)

My query should say: "show me how many bytes are send every hour, starting from date #*$!x-xx-xx xx:xx:xx and ending with #*$!x-xx-xx xx:xx:xx".

Thanks in advance! :-)

phranque

9:02 pm on Apr 13, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you could try something like this:
SELECT SUM(bytes_sent), DATE_FORMAT(time_stamp, %Y%m%d%H) AS date_hour FROM table_name WHERE time_stamp > YYYYMMDDHH AND time_stamp < YYYYMMDDHH GROUP BY date_hour

cdmn

6:14 am on Apr 14, 2007 (gmt 0)

10+ Year Member



Brilliant!
I own you one!