If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Survey Qustion
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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200911/1 |
#2
|
|||
|
|||
Survey Qustion
On Mon, 23 Nov 2009 21:08:45 GMT, "dsmith via AccessMonster.com" u56186@uwe
wrote: 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. -- John W. Vinson [MVP] |
#3
|
|||
|
|||
Survey Qustion
dsmith via AccessMonster.com wrote:
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 -- Marsh MVP [MS Access] |
#4
|
|||
|
|||
Survey Qustion
thanks I think I understand...
John W. Vinson wrote: 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. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200911/1 |
#5
|
|||
|
|||
Survey Qustion
Thanks. I used a combination of the info from you and John...teamwork.
Marshall Barton wrote: 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200911/1 |
Thread Tools | |
Display Modes | |
|
|