Hello all,
I'm struggling to come up with a recordsource for a report in the following circumstances:
Employees work on Shifts, each shift has multiple deliveries, each delivery is to a certain district.
What I need is a report grouped by district, showing the employees who have NOT made a delivery to that district.
This would be something along the lines of:
District A
Employee 3
Employee 5
District B
Employee 2
Employee 9
and so on.
I can get the recordsource correct to show which employees HAVE made deliveries to each district.
And I can come up with a recordsource that shows me who has not made any deliveries to any district (or I can limit it to a particular district by adding that to the WHERE statement)
But I can't figure out what recordsource I would need to be able to produce the report described above.
If anybody can offer any suggestions or help that would be very much appreciated (even if the help is stating that it can't be done!)
I'm struggling to come up with a recordsource for a report in the following circumstances:
Employees work on Shifts, each shift has multiple deliveries, each delivery is to a certain district.
What I need is a report grouped by district, showing the employees who have NOT made a delivery to that district.
This would be something along the lines of:
District A
Employee 3
Employee 5
District B
Employee 2
Employee 9
and so on.
I can get the recordsource correct to show which employees HAVE made deliveries to each district.
And I can come up with a recordsource that shows me who has not made any deliveries to any district (or I can limit it to a particular district by adding that to the WHERE statement)
Code:
SELECT lngEmployeeID, strFullName FROM tblEmployees e
WHERE NOT EXISTS (SELECT * FROM tblShifts s
INNER JOIN tblDeliveries d ON s.lngShiftID = d.lngShiftID
WHERE e.lngEmployeeID = s.lngDriver OR e.lngEmployeeID = s.lngLoader
If anybody can offer any suggestions or help that would be very much appreciated (even if the help is stating that it can't be done!)