survey type system

  • Thread starter enrico via AccessMonster.com
  • Start date
E

enrico via AccessMonster.com

i'm trying to create a simple survey system. for example, i have 5 questions
with an agree, satisfied and disagree choices namely: a1, a2, a3, a4 and a5.
how can i query it that the result will show how many respondents answer an
agree, disagree and satisfied in a1, a2, and so forth? i only need the count
and not the names of the respondents itself
 
K

KARL DEWEY

I think you need a union query then a totals.
SELECT "a1" AS Question, a1 AS Answer
FROM YourTable
UNION ALL SELECT "a2" AS Question, a2 AS Answer
FROM YourTable
UNION ALL SELECT "a3" AS Question, a3 AS Answer
FROM YourTable
UNION ALL SELECT "a4" AS Question, a4 AS Answer
FROM YourTable
UNION ALL SELECT "a5" AS Question, a5 AS Answer
FROM YourTable;

Then --
SELECT Question, Answer, Count([Answer]) AS Respondents
FROM YourUnionQuery
GROUP BY Question, Answer;
 
E

enrico via AccessMonster.com

thank you. what if i didn't write the question in the database, only the
answer. i only wrote the question in the form and only the answer is saved in
the database
 

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