The below code counts the number of records within the given date range. Please let me know how I can modify this so that it counts the number of records every hour within the given date range.
So from May 1 to May 3, I want it to list the number of records each hour at the hours 7 AM, 8AM, 9AM, 10AM..............to 6PM. So for 7AM, it should list the number of records that occured from 7AM to 7:59AM from May 1 to May 3.
strSQL = "SELECT COUNT(*) AS numCase, Int(Time_Open) AS numDate FROM tbl_Closed Where Time_Open >= #" & txtDateStart & "# AND Time_Open <= #" & DateAdd("d", 1, txtDateEnd) & "# GROUP BY Int(Time_Open)"