Unmatched query

  • Thread starter Thread starter Mary
  • Start date Start date
M

Mary

I could use some help with an unmatched query. I have two
tables with vacation code data. Each table has fields for
Employee ID, Date, Code, Hours. I need a query that will
show any records that have any field in the row that
doesn't match. I must be setting the criteria wrong,
because the query is picking up things that are on both
tables. I need to compare the way the vacation time
should have been coded in table 1 with the way it was
actually coded in payroll, table 2.

Is this possible in one query? How would I set the
criteria?

Thank you so much!
Mary
 
-----Original Message-----
I could use some help with an unmatched query. I have two
tables with vacation code data. Each table has fields for
Employee ID, Date, Code, Hours. I need a query that will
show any records that have any field in the row that
doesn't match. I must be setting the criteria wrong,
because the query is picking up things that are on both
tables. I need to compare the way the vacation time
should have been coded in table 1 with the way it was
actually coded in payroll, table 2.

Is this possible in one query? How would I set the
criteria?

Thank you so much!
Mary
.
Are you using the unmatched query wizard ?
 
Possibly

SELECT A.*, B.Code
FROM TableA as A INNER JOIN TableB as B
ON A.[Employee ID] = B.[Employee ID] AND
A.[Date] = B.[Date] AND
A.[Hours] = B.[Hours]
WHERE A.Code <> B.Code

That assumes that the three fields in the join match.

If you are doing this in the query grid, you have to drag three join lines from
A to B. One for each set of fields that should match up.
 
Back
Top