jadams0173
Technical User
- Feb 18, 2005
- 1,210
I'm trying to find unmatched records in 2 tables. Should be pretty straightforward and I've done it numerous times but I'm having a "spell" on this one.
my query that I have will return only the matched rows.
I tried to have patience but it took to long!
-DW
Code:
Table temp_req
jobnumber (text)
PreReq (text)
Temp Records
EmpNo (text)
CourseNo (text)
temp_req data
JobNumber PreReq
100 0001
100 0002
100 0003
100 0004
100 0005
TempRecords
EmpNo CourseNo
12345 0001
12345 0002
12345 0003
Expected Output
EmpNo prereq courseno
12345 0001 0001
12345 0002 0002
12345 0003 0003
12345 0004
12345 0005
my query that I have will return only the matched rows.
Code:
SELECT tblJobReq.PreReq, tblJobReq.JobNumber, TempRecords.CourseNo, TempRecords.EmpNo
FROM tblJobReq LEFT JOIN TempRecords ON tblJobReq.PreReq = TempRecords.CourseNo
GROUP BY tblJobReq.PreReq, tblJobReq.JobNumber, TempRecords.CourseNo, TempRecords.EmpNo
HAVING (((tblJobReq.JobNumber)="100") AND ((TempRecords.EmpNo)="12345"))
I tried to have patience but it took to long!