Count Unique records with yes/no values in Query

JoysTick

Registered User.
Local time
Today, 03:46
Joined
Sep 28, 2001
Messages
10
I have a table [tblClientVisits] related to a table [tblClients] by a [ClientID] foreign key.

I have a number of Yes/No fields in [tblClientVisits]which are grouped into "categories". e.g.
Category1Question1YesNo
Category1Question2YesNo
Category1Question3YesNo
Category2Question1YesNo
Category2Question2YesNo
Category2Question3YesNo etc. etc.

For each "category" I'm trying to find out how many unique clients ticked Yes for one or more of the yes/no fields in the category.

I'm not interested in how many of the fields they ticked, just if they ticked yes in one of the fields in a given category. I then want a count of the unique clients who had ticked Yes.

I think I'll need to test for a Yes in each of the fields in each category for each client but I'm not sure how to implement this.

Any ideas please?

Thanks :-)
 
IIF within IIF Statements

You can use this to return a "1" in the field, allowing you to do a Sum in another query.
 
Forgot to mention that I only really need the answer to this as a clculated control on a report, as I want to find out the total number of Unique Clients who ticked yes in any of the fields in each of the category. I'll need to do the calculation for each group of fields in the category and end up with a count of unique Clients that I can then use to work out what percentage of all Clients answered Yes to any of the fields in the category.

I'm not sure if this has any bearing on your answer...

I think (rather I hope..)I can follow through on the nested If statements to get a 1 to allow me to use this answer in another query, but I'm not sure how then to use this information to get a unique client count.

tx.
 

Users who are viewing this thread

Back
Top Bottom