Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to output survey results

Status
Not open for further replies.

jmj

Programmer
Oct 4, 2001
122
US
I inherited a table used for a survey. Each question of the survey is a field name, and there are 35 questions in the survey.
So each person that takes the survey adds one row to the table
They want to results like outputted
1. by place evaluated (mall, school, etc)
2. the question with a count of the results
3. Under the count for the results they want a % of the responses.
so it'll look like so:
Greenwood School
Question StrongAgree Agree Disagree StrongDis
Q1-clean environment 20 15 7 2
Avg for Q1 46% 34% 16% 4%
Q2-Helpful Staff 18 17 7 0
Avg for Q2 42% 40% 16% 0%

Maybe I'm being uncreative, but I can't think of anything other than doing a big case statement- then kick it to excel to pull apart.
Are there better options?
Thanks,
J
 
> Are there better options?

You can normalize data into temp table and then do everything with 3-4 conventional SQL queries. Not much more elegant but existing (lack of) table design sux so...

Post few rows with sample data (and column names) here.



------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top