I wish to create a report based on a query that compares results from multiple sources. The result should only show those records (from one source) that are NOT matched in the second source.
This is for analysis of training; actual training received against required.
I've created 3 queries; the 1st to identify the training received. The second to identify training required (for a particular role) and a third to combine the others.
It's in this 3rd query that I'm struggling.
1st query
Code: Select all
SELECT TblPerson.PersID, [FirstName] & " " & [LastName] AS Employee, tblPersonRoles.RendDate, TblPerson.LastName
FROM TblPerson INNER JOIN tblPersonRoles ON TblPerson.PersID = tblPersonRoles.PersID
WHERE (((tblPersonRoles.RendDate) Is Null))
ORDER BY TblPerson.LastName;
Code: Select all
SELECT TblRole.RoleName, TblRole.RqdPersNos, Count(tblPersonRoles.PersID) AS CountOfPersID
FROM TblRole LEFT JOIN tblPersonRoles ON TblRole.RoleID=tblPersonRoles.RoleID
WHERE (((tblPersonRoles.RendDate) Is Null))
GROUP BY TblRole.RoleName, TblRole.RqdPersNos;
Code: Select all
SELECT qryPersGAP1.PersID, qryPersGAP1.name, qryPersGAP2.CName
FROM qryPersGAP1, qryPersGAP2
WHERE (([qryPersGAP2]![CName]<>[qryPersGAP1]![CName]))
GROUP BY qryPersGAP1.PersID, qryPersGAP1.name, qryPersGAP2.CName;