I am working on a query that will be used for a report that displays the following:
A user selected Job Site (tblJobSites)
A Supervisor (sometimes more than one)(tblJobSiteSupervisors)
and then all personnel assigned to that job site on the same days as the supervisor (tblParticipants).
tblParticipants tblJobSites tblJobSiteSupervisors
BookingNumber(pk) JobSiteNumber(pk) ID (pk)
Sunday (y/n) Sunday (Y/n) (etc) LastName
Monday (y/n) SupervisorNumber Sunday (Y/n)(etc)
Tuesday (y/n)(etc)
JobSiteNumber
I have all three tables in my query and can select the Job Site I want easily. The problem is that I get all the supervisors matched with all the participants. I need to limit the returns to only the participants that match the workdays of the supervisor over them. The workday (Y/N boxes) are checked for the days the supervisor or participant work. I figure this is a join problem, but dont know where to go from here.
Another glitch is that the supervisors may work M-F while some of the participants only are there on M or W or any of the other combinations.
I can post the SQL code if needed, but how do you put that inside another box.
Thanks in advance....
A user selected Job Site (tblJobSites)
A Supervisor (sometimes more than one)(tblJobSiteSupervisors)
and then all personnel assigned to that job site on the same days as the supervisor (tblParticipants).
tblParticipants tblJobSites tblJobSiteSupervisors
BookingNumber(pk) JobSiteNumber(pk) ID (pk)
Sunday (y/n) Sunday (Y/n) (etc) LastName
Monday (y/n) SupervisorNumber Sunday (Y/n)(etc)
Tuesday (y/n)(etc)
JobSiteNumber
I have all three tables in my query and can select the Job Site I want easily. The problem is that I get all the supervisors matched with all the participants. I need to limit the returns to only the participants that match the workdays of the supervisor over them. The workday (Y/N boxes) are checked for the days the supervisor or participant work. I figure this is a join problem, but dont know where to go from here.
Another glitch is that the supervisors may work M-F while some of the participants only are there on M or W or any of the other combinations.
I can post the SQL code if needed, but how do you put that inside another box.
Thanks in advance....