Finding non matching Data

  • Thread starter Thread starter BATTLESHIP
  • Start date Start date
B

BATTLESHIP

If i create a Querry between two data tables is it possible for me to also
show the items that do not match. For instance I set up the relationship to
show all of the left side and only the table on the right side where it
matches the left side. But then also show only the items on the right side
that did not match the left side. More of an exception list?
thanks
 
click Query, New and select 'Find Unmatched Query Wizard'. It will guide you
step by step.
 
This requires a UNION ALL Query that is composed of two Unmatched
queries. You could use the Unmatched query wizard to build the two
queries and then union them.

You would end up with something like the following

SELECT "TableA Only" as theSource
, A.FieldA, A.FieldB, A.FieldC
FROM A LEFT JOIN B
ON A.FieldA = B.FieldA
WHERE B.FieldA is Null
UNION ALL
SELECT "TableB Only" as theSource
, B.FieldA, B.FieldB, B.FieldC
FROM A RIGHT JOIN B
ON A.FieldA = B.FieldA
WHERE A.FieldA is Null

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
Back
Top