I have a date time field in a MySQL database and wish to output the result to the nearest hour.
e.g. 2012-04-01 00:00:01 should read 2012-04-01 00
2012-04-01 00:00:01
2012-04-01 00
If you need to round just time to next hour you may use this:
SELECT TIME_FORMAT( ADDTIME( TIMEDIFF('16:15', '10:00'), '00:59:00' ), '%H:00:00' )