Question Compare 2 tables where one record matches and another doesn't

lynxbci

Registered User.
Local time
Today, 15:59
Joined
Nov 27, 2007
Messages
73
Hi
I have table A with a list of Work Instruction references (WIREF) and a Issue number (ISSNO).
I have Table B wth employees and they too have a Work Instruction (empWIREF) and Issue number (empISSNO).
I want to check if the Work instruction Issue has changed since the employee was trained
check:
WIREF = empWIREF and ISSNO <> empISSNO for all records in table B

How can i do this?

Thanks
 
In SQL terms, this would be an approach

SELECT empID, WIREF, ISSNO
FROM [table A] inner join [table B]
ON [table A].WIREF = [table B].empWIREF
WHERE [table A].ISSNO <> [table B].empISSNO

you say "changed since the employee was trained", the above may be more complicated if the trained date has to be considered and the work instruction WIREF changes multiple times, but if it just changes only once and that's when the employee is trained, then the above should work

David
 
Thanks very much, all working
 

Users who are viewing this thread

Back
Top Bottom