MySQL select using datetime, group by date only
- by Matt
Is is possible to select a datetime field from a MySQL table and group by the date only?
I'm trying to output a list of events that happen at multiple times, grouped by the date it happened on.
My table/data looks like this: (the timestamp is a datetime field)
1. 2010-03-21 18:00:00 Event1
2. 2010-03-21 18:30:00 Event2
3. 2010-03-30 13:00:00 Event3
4. 2010-03-30 14:00:00 Event4
I want to output something like this:
March 21st
1800 - Event 1
1830 - Event 2
March 30th
1300 - Event 3
1400 - Event 4
Thanks!