This query works great...but only if I have atleast 1 record in Attendance table. I'd like it to work even when Attendance is empty (which it will be when I first deploy this to the team). I can populate a dummy record if required but I'd rather not.
Intention is to grab all people with "Attendee","Scheduler","Admin" access AND get "Attendee (temp)" people IF they have a record in the attendance table for the current event.
Attendance table:
ID
EventID
EmployeeID
Code:
SELECT Q1.Security.ID AS EmpID, Q1.Security.FirstName & " " & Q1.Security.LastName AS EmployeeName
FROM (SELECT Security.ID, Security.FirstName, Security.LastName FROM Events, Security, Attendance WHERE ((Attendance.EmployeeID=Security.ID) AND (Forms!Navigation!NavigationSubform.Form!ID = Attendance.EventID) AND (Security.Access ="Attendee (temp)")) OR (Security.Access IN ("Attendee","Scheduler","Admin"))) AS Q1
GROUP BY Q1.Security.ID, Q1.Security.FirstName & " " & Q1.Security.LastName
ORDER BY Q1.Security.FirstName & " " & Q1.Security.LastName;