qry concern

B

Bri

Hello - hope this isn't too much of a newbie question.
I have a table with two fields (id, category) forming the primary key.
Both are text. Typical entries are:

ste 015
bri 015
ste 035
chr 025
ann 015
ste 020

I wan't to write a query that lists the id and category if
that id has ONLY the category "015". In the case shown, the qry should
show:

bri 015
ann 015

ste is excluded because there is also a 'ste 035'.
Thanks for any help Dorre
 
V

Van T. Dinh

May not be the most efficient but try the SQL String:

SELECT [id], [category]
FROM [YourTable]
WHERE [id] NOT IN
( SELECT [id]
FROM [YourTable]
WHERE [category] <> '015'
)
 
J

John Vinson

I wan't to write a query that lists the id and category if
that id has ONLY the category "015". In the case shown, the qry should
show:

bri 015
ann 015

Simply create a Query based on the table; select the Category and ID
fields. On the Criteria line under ID type

"015"

Open the query by clicking the icon at the left end of the toolbar.
 
J

John Vinson

BLUSH!!!!

Sorry for my hasty previous answer. Missed a key word in the question!

<hiding my head in chagrin>
 

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

Top