Unmatched query

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
 
L

Larry

-----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 ?
 
J

John Spencer (MVP)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top