In the query add your identifier field (e.g. NAMES). Then add the YES/NO column. Click the TOTALS button and set the YES/NO column's Total: value to count. Add the YES/NO column again and change the totals value to WHERE. Set the criteria to True. That should give you a count of the yes's.
A more long term solution would be to normalize your data. Assuming there is a person who has answered yes/no to each of these activities, what you have is a many to many relationship (one person can have many activities each activity can have many people who do it). Your structure should be:
People
ID
Name
Other personal Info
Activities
ID
Description
PeopleActivities
PeopleID
ActivityID
With your current structure, anytime you need to add a new activities (Basketweaving, Horseback Riding, etc.) you are going to have to change the table structure to include the new activity AND change all the queries to include the new field. With the normalized structure, you would just have to add a new record to the Activity table.
Leslie
Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
Already covered so many times ...
SELECT Sum(Abs([Soccer])) AS CountOfSoccer, Sum(Abs([Skiing])) AS CountOfSkiing, Sum(Abs([Basketball])) AS CountOfBasketball
FROM yourTable;
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
I doubt it is "working perfect" unless you have normalized your tables as suggested by Leslie (who needs a star).
Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.