Help with a SQL Statement

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

I need to create a SQL statement that will return rows
from one table that were supposed to be appended to
another. In other words:

Show me all rows in table A where the (ID, Code and Date)
combination aren't in table B.

It sounds simple, but my old brain doesn't work like it
used to...

Thanks.
 
Access figured it out for me.....

SELECT A.Num, A.LeaveCode, A.AccruedHours, A.EffDate
FROM A LEFT JOIN B ON (A.Num = B.sEmployeeIDf) AND
(A.LeaveCode = B.sLeaveCodeIDf) AND (A.EffDate =
B.dtmPayDate)
WHERE (((B.sEmployeeIDf) Is Null) AND ((B.dtmPayDate) Is
Null) AND ((B.sLeaveCodeIDf) Is Null));

....just in case anyone was interested.
 
Back
Top