Possible for a single query to output UNMATCHED in both directions?
am 15.10.2007 16:27:19 von MLH
For many versions, Access has had query wizard to
identify and list records in table A that had no matching
records in table B. But suppose that in addition to that,
I would like to see records in table B that have no matching
records in table A - at the same time and in the same dynaset.
Can that be done?
Suppose you have tblDadsGroceryList and tblSonsGroceryList
and that they should contain the same items - but they don't.
And for a little spice, suppose both lists contain 12 items. In the
past, to identify the inconsistencies in either list, I've always had
to use two queries. Do any of you know how to do it with just one?
Re: Possible for a single query to output UNMATCHED in both directions?
am 15.10.2007 16:42:40 von Allen Browne
You could do this by creating 2 SELECT statements (one going each
direction), and then UNION them into a single, long list.
The Wiz. can create the 2 statements for you.
Make sure you have the same number of fields output, of the same data type,
in the same order.
Then switch to SQL view, replace the semicolon at the end of the first one
with the words:
UNION ALL
and then paste in the SQL statement from the other one.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"MLH" wrote in message
news:uet6h3dl0ra9rlf1fd97640os2qkr8o9ou@4ax.com...
> For many versions, Access has had query wizard to
> identify and list records in table A that had no matching
> records in table B. But suppose that in addition to that,
> I would like to see records in table B that have no matching
> records in table A - at the same time and in the same dynaset.
> Can that be done?
>
> Suppose you have tblDadsGroceryList and tblSonsGroceryList
> and that they should contain the same items - but they don't.
> And for a little spice, suppose both lists contain 12 items. In the
> past, to identify the inconsistencies in either list, I've always had
> to use two queries. Do any of you know how to do it with just one?