
March 3rd, 2004, 05:30 PM
|
|
Contributing User
|
|
Join Date: Oct 2003
Location: Queensland, Australia
Posts: 256
Time spent in forums: 58 m 53 sec
Reputation Power: 6
|
|
|
Drop tables A, B, and C into the query builder and make joins between 'A and B' and 'A and C'. Table A should be the "One" side of the One to Many joins.
Select the EmpID, PID and RID fields and any others you may require.
In the criteria for the PID and RID fields put "Is Null"
Go to datasheet view and you should see the records you require.
The SQL for the query is as follows.
SELECT Personell.PID, Employees.EmpID, Residents.RID
FROM Residents RIGHT JOIN (Personell RIGHT JOIN Employees ON Personell.PID = Employees.EmpID) ON Residents.RID = Employees.EmpID
WHERE (((Personell.PID) Is Null) AND ((Residents.RID) Is Null));
|