You can use an ORDER BY date to sort the events by date. Iterate through the dataset returned and when you hit a new date, output the date. Something like that should work.