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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with SELECT query in Access 1

Status
Not open for further replies.

jwalacha

Programmer
Aug 2, 2002
33
US
I present a simplification of my problem here:
I have two tables, Table1 and Table2, both of which contain a column: City.
Table1.City contains 3 entries: Rome, Delhi, Boston.
Table2.City contains 2 entries: Rome, Delhi.

I want to select the city from Table1 that EXISTS in Table1 AND NOT IN Table2. (Boston)

Can someone please give me the correct syntax to accomplish the above? I appreciate your help.

Regards,

Jay.
 
Hi
SELECT DISTINCTROW Table1.city
FROM Table1 LEFT JOIN Table2 ON Table1.city = Table2.city
WHERE (((Table2.city) Is Null));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top