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.
 

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

Back
Top