Question
recordcount & IF statement problem
Hi
I am trying to create a summary page for a questionnaire.
I need to count the number of same values in a column, so if there are 3 "1s" the return will be 3.
I'm using the following code
<cfoutput query="qcount"><cfif s1q1 IS 1>#qcount.recordcount#</cfif></cfoutput>
This returns the amount of "1s" but repeats as many times as there are "1's" in the column; so if there are 3 "1s" I get 333
How can I stop this? I want to avoid using multiple queries as there are lots of questions and want to keep the code as short as possible.
Thanks
Michael
I am trying to create a summary page for a questionnaire.
I need to count the number of same values in a column, so if there are 3 "1s" the return will be 3.
I'm using the following code
<cfoutput query="qcount"><cfif s1q1 IS 1>#qcount.recordcount#</cfif></cfoutput>
This returns the amount of "1s" but repeats as many times as there are "1's" in the column; so if there are 3 "1s" I get 333
How can I stop this? I want to avoid using multiple queries as there are lots of questions and want to keep the code as short as possible.
Thanks
Michael
