Counting survey responses, 4 queries or 1 query??
- From: "tlyczko" <tlyczko@xxxxxxxxx>
- Date: 16 Apr 2006 14:41:50 -0700
I have a 'survey' database. I store the questions and responses in
separate tables.
tblResponses has the following fields:
ResponseID (PK)
Question ID (FK)
Survey ID (so I know which responses go with which survey)
txtResponse (values can be Y (Yes), N (No), or X (Not Applicable)
a few other fields
I know it's easy to make separate 'counting' queries to count all the Y
answers, all the N answers, all the X answers.
Is it possible to create ONE query that gives counts of all the
different possible answers??
That is, have a query which gives results, for example, 37 Yes, 29 No,
10 X (Not Applicable) PER Question ID????
Or do I need to use three separate queries anyway, then use a fourth
query to bring together all the results and calculate percentages and
whatnot???
I would prefer not to use crosstab queries, there are MANY questions
per survey...and crosstab queries don't scale up to SQL Server...
I hope this is enough information...
Thank you, Tom
.
- Follow-Ups:
- Prev by Date: Re: concatenate function
- Next by Date: Re: concatenate function
- Previous by thread: Re: Expression in query
- Next by thread: Re: Counting survey responses, 4 queries or 1 query??
- Index(es):
Relevant Pages
|