you have a number of issues with your data
1. nonsense records - records 58 and 59
2. you have other records with a time element but a different title structure - rexcords 56 and 57
3. you have shifts that start at 10pm and finish the following day
4. your time fields are not just time, they include a date element which does not reflect the fact the end date is the following day
this query ignores all these records
Code:
TRANSFORM Count([Counter])/4 AS Expr1
SELECT DateValue([start_time]) AS Expr2
FROM ztblSchedules_3_22_19, admCount
WHERE (((admCount.[counter])>=CInt(([Start_Time]-3)*24*4) And (admCount.[counter])<CInt(([End_Time]-3)*24*4)) AND ((ztblSchedules_3_22_19.Title) Not In ("None","-")) AND ((ztblSchedules_3_22_19.End_Time)>[Start_Time]))
GROUP BY DateValue([start_time])
PIVOT ([Counter]\4)
to make this work you need to create this table with the name admCounter
and this query which you should save as admCount
Code:
SELECT CLng([singles].[ctr]+([tens].[ctr]*10)) AS [Counter]
FROM admCounter AS singles, admCounter AS tens
ORDER BY CLng([singles].[ctr]+([tens].[ctr]*10));
the result of the query based on the data provided is
Expr2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
02/01/1900 |
9 |
21 |
31.5 |
37.75 |
40.5 |
41 |
42 |
48.75 |
50 |
41 |
27.75 |
19 |
15 |
11 |
11 |
9.5 |
0.75 |