Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select all records in Table A that aren't In Table B 2

Status
Not open for further replies.

redaccess

MIS
Aug 2, 2001
110
US
As the title of this thread suggests, I want to select all of the records in tbl_A that aren't in tbl_B according to ID#. Is there a way to do this with one query?
 
yep, you need to do an outer (aka left) join. something like this:

SELECT tbl_A.*
FROM tbl_A LEFT JOIN tbl_B ON tbl_A.ID = tbl_B.ID
WHERE tbl_B.trade_acct Is Null;
Best Regards,
Mike
 
If you are using Access97, you can use the "Find UnMatched Query Wizard". I fing this very useful for this type of situation.
 
If you are using Access97, you can use the "Find UnMatched Query Wizard". I find this very useful for this type of situation.
 
Here is another way:

SELECT tblA.NameA
FROM tblA
WHERE not exists (select tblB.NameB from tblB where tblA.NameA = tblB.NameB)=true;

GGleason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top