Ik vermoed dat je gewoon iets wilt als: SELECT HOUR(ShoppingDate), COUNT(*) FROM YourTable GROUP BY HOUR(ShoppingDate)