Display dates events in detailedResult, correct count sql query