<cfquery name="queryname">
select q1, q2, .... from table
</cfquery>

<cfset q1list = ValueList(queryname.q1, ",")>
<cfset q1listcount1 = ListValueCount(q1list, 1, ",")><cfset q1listcount2 = 
ListValueCount(q1list, 2, ",")>
<cfset q1listcount3 = ListValueCount(q1list, 3, ",")>

At 03:49 PM 1/29/2003 -0500, you wrote:
>Hi all,
>
>I have a table with columns named q1,q2,q3, through q19. Each question can 
>have a value of 1, 2, or 3. How can I generate a query/cfcode that will 
>tell me how many people answered 1, 2, and 3 for question 1 through 
>question 19 without having a ton of queries? I know it needs to loop 
>somehow, but it just hasn't worked out correctly so far.
>
>thx,
>
>- gary
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to