I need to count records in each 8h (starting from first adequate hour) during day (6-22) and in each 0,5h (starting from first adequate hour) during night (22-6). For example if there is 21:50; 22:20; 22:25; 22:30; 22:50; 23:05; 23:15; 23:45 then the first adequate hour for night is 22:20...