Query Question

  • Thread starter Thread starter Kevin Pedersen
  • Start date Start date
K

Kevin Pedersen

I have two tables:

---------------- ----------------
| Street | | Business |
|----------------| |----------------|
| id | name | | id | streetId |
|----------------| |----------------|
| 1 | Main | | 1 | 1 |
| 2 | First | | 2 | 3 |
| 3 | Second | ----------------
| 4 | Fifth |
----------------

What I want to do is select all of the streets that don't have a
business associated with them.

Thanks in advance,
Kevin
 
Hi,


Or run the query wizard about finding unmatched records. You want
Streets unmatched in Business.



Hoping it may help,
Vanderghast, Access MVP
 
I noticed a small mistake.
I believe the query should be:

Select * from Street Where Street.ID
Not in (Select Distinct Street.ID from Business);

This should get you what you want.
 
Works like a charm. Thanks to all of you.

Kevin

Warren said:
I noticed a small mistake.
I believe the query should be:

Select * from Street Where Street.ID
Not in (Select Distinct Street.ID from Business);

This should get you what you want.
 
Back
Top