qry concern

  • Thread starter Thread starter Bri
  • Start date Start date
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
 
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'
)
 
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.
 
BLUSH!!!!

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

<hiding my head in chagrin>
 
Back
Top