Need Help on "Yes/No" Query

J

jcrowe

Hi,
I have a table with the following fields;

ID - AutoNumber
Retailer - Text
Product SKU - Text
Feature 1 - Yes/No Check Block
Feature 2 - Yes/No Check Block
Feature 3 - Yes/No Check Block
Feature 4 - Yes/No Check Block
Feature 5 - Yes/No Check Block
Feature 6 - Yes/No Check Block
Feature 7 - Yes/No Check Block
Feature 8 - Yes/No Check Block


etc...Total of 20 Features

I need to run a query that will pull ONLY the Features
that are "Yes".

For example;
ID1 may have Features 1,3,5,7 that are "Yes".
ID2 may have Features 2,4,6,8 that are "Yes"

I only want the Features that are marked "Yes" to show

Is this possible ?

Thanks,
JCrowe
 
G

Guest

In your query, change the Criteria field under each feature to say "Yes" and
it will only pull the features that have been marked "Yes"
Criteria box is fun to play with, you can put expressions in there, or ask
for user input using square brackets, etc...
 
R

Rick B

that is not completely true.

If you do as he said and put all your criteria on the same row of your
criteria section, it creates an "and" condition where it would only pull
records where all fields were checked.

Putting them on separate rows creates an "or" and would pull all records
with at least one field checked. I'm not positive you can have 20 rows
though.

In any case, this does not accomplish what you asked for. You are asking
for as you would get something like...

Product A Yes No Yes No Yes Yes...
Product B Yes No No No Yes Yes...
Product C No No Yes No Yes Yes...

I don't have the solution for you, but I know that Cheech's will not do what
you described.
 
M

Michel Walsh

Hi,





SELECT SKU, Mid( iif(feature1, ",1 ", null) &
iif(feature2, ",2 ", null) &
iif(feature3, ",3 ", null) &
...
iif(feature20, ",20 ", null) , 2)

FROM myTable





Hoping it may help,
Vanderghast, Access MVP
 

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