I have the following query which returns staff-level non-productive activities by team. The StaffMap table simply maps staff IDs to team IDs (or groups), but has start and end dates.
Can someone help me modify the SQL to account for these start and end dates? Let's say I wanted activities between Jan-1 and Jan-10, but only for staff that were in the team at the time, with the possibility that the staff could switch teams in the reporting period.
(((tblStaffMap INNER JOIN tblStaff ON tblStaffMap.Staff_ID = tblStaff.ID)
INNER JOIN tblActivityLog ON tblStaffMap.Staff_ID = tblActivityLog.Staff_ID)
INNER JOIN tblActivities ON tblActivityLog.Activity_ID = tblActivities.ID)
INNER JOIN tblGroups ON tblStaffMap.Group_ID = tblGroups.ID
ORDER BY tblActivityLog.Start_Date
Thanks in advance of any help.