[Repost] Getting Non-Matching Keys Possible?

A

aleatory

Hi all,

I'm reposting this to other Access-related newsgroups.
So far nobody has replied to my question.

Many thanks in advance,

alea
 
C

Cheryl Fischer

Would the following work for you? It is a query that is slightly modified
from the "Find Unmatched Query Wizard".

SELECT Table1.[key1], Table1.[key2]
FROM Table1 LEFT JOIN Table2 ON (Table1.[key1] = Table2.[key1]) AND
(Table1.[key2] = Table2.[key2])
WHERE (((Table2.[key1]) Is Null) AND ((Table2.[key2]) Is Null));

The above should return all records in Table1 which do not have matching
keys in Table2.
 
A

aleatory

Hi Cheryl,

Thanks for the great tip! It worked great
and produced correct outputs.

By the way, I just wonder why MS Access
SQL is so different from other implementations
such as Oracle and Informix. It would have been
virtually impossible for me to come up with the
code from Cheryl!

Thanks again Cheryl.

alea



Cheryl Fischer said:
Would the following work for you? It is a query that is slightly modified
from the "Find Unmatched Query Wizard".

SELECT Table1.[key1], Table1.[key2]
FROM Table1 LEFT JOIN Table2 ON (Table1.[key1] = Table2.[key1]) AND
(Table1.[key2] = Table2.[key2])
WHERE (((Table2.[key1]) Is Null) AND ((Table2.[key2]) Is Null));

The above should return all records in Table1 which do not have matching
keys in Table2.


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


aleatory said:
Hi all,

I'm reposting this to other Access-related newsgroups.
So far nobody has replied to my question.

Many thanks in advance,

alea

(e-mail address removed) (aleatory) wrote in message
 

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