JE said:
Hello,
I have two tables that are unique based on Account Number. I want
everything in table A where account number in table A is not found in
table
B. This is a design view table. I am extremely new to MS Access and
would
like to keep this simple. Can someone direct me to a resource that I can
reference to accomplish this? Many thanks.
Try this:
1. Create a new query, not based on any table.
2. Switch to SQL View.
3. Enter this SQL:
SELECT * FROM [Table A]
WHERE [Account Number] NOT IN
(SELECT [Account Number] FROM [Table B]);
In the above, replace "Table A" with the real name of your table A, "Table
B" with the real name of your table B, and "Account Number" with the name of
the account-number field in both tables. If that field has a different name
in each table, replace the first use of "Account Number" with the name of
that field in Table A, and the seconf use of "Account Number" with the name
of that field in Table B.
4. Switch to datasheet view to see if you get the correct results. If you
do, you can switch to design view to see what such a query looks like in
design view.
Note: the "find unmatched" query wizard will create a slightly different
query that should return the same results. That query will generally be
more efficient than the one above, but the way it works is less clear. That
one would have SQL like this:
SELECT [Table A].* FROM [Table A] LEFT JOIN [Table B]
ON [Table A].[Account Number] = [Table B].[Account Number]
WHERE [Table B].[Account Number] Is Null;