Survey Qustion

  • Thread starter dsmith via AccessMonster.com
  • Start date
D

dsmith via AccessMonster.com

I'm working on a survey database but I 've run into a problem. The series of
questions I'm asking will all have 1 of 3 possible answers; yes, no, or NA.
I'm using a drop down box that provides the choices to the user. Is there a
way to do this and be able to count the number of times each answer is
selected? I've tried using the yes/no featue but couldn't solve the "NA"
option
 
J

John W. Vinson

I'm working on a survey database but I 've run into a problem. The series of
questions I'm asking will all have 1 of 3 possible answers; yes, no, or NA.
I'm using a drop down box that provides the choices to the user. Is there a
way to do this and be able to count the number of times each answer is
selected? I've tried using the yes/no featue but couldn't solve the "NA"
option

You won't be able to use a Yes/No field in the table. Try using an Integer
field instead, using (say) 0 for No, 1 for Yes, 2 for NA; you can use an
Option Group control or a Combo Box on the form to select the appropriate
choice.
 
M

Marshall Barton

dsmith said:
I'm working on a survey database but I 've run into a problem. The series of
questions I'm asking will all have 1 of 3 possible answers; yes, no, or NA.
I'm using a drop down box that provides the choices to the user. Is there a
way to do this and be able to count the number of times each answer is
selected? I've tried using the yes/no featue but couldn't solve the "NA"
option


If I understand what you are trying to do??

This is a standard way to do that kind of thing:

SELECT QuestionNumber, Answer, Count(*)
FROM table
GROUP BY QuestionNumber, Answer

But, I suspect that this is more like what you want:

SELECT QuestionNumber,
Sum(IIf(Answer = "Yes", 1, 0)) As NumYes,
Sum(IIf(Answer = "No", 1, 0)) As NumNo,
Sum(IIf(Answer = "NA", 1, 0)) As NumNA,
FROM table
GROUP BY QuestionNumber
 
D

dsmith via AccessMonster.com

thanks I think I understand...
You won't be able to use a Yes/No field in the table. Try using an Integer
field instead, using (say) 0 for No, 1 for Yes, 2 for NA; you can use an
Option Group control or a Combo Box on the form to select the appropriate
choice.
 
D

dsmith via AccessMonster.com

Thanks. I used a combination of the info from you and John...teamwork.
 

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