I'm trying to use arraysum with a query column to get the sum of all the values, but it just sees the first value, instead of an array. Is there some special way to do this?
My code:
<cfquery name="get_results1" datasource="xxx">
SELECT DISTINCT(q1), COUNT(q1) AS q_count FROM survey GROUP BY q1
</cfquery>
(This returns all unique records, and how many of each there are, I want a total so I can find %)
<cfset total = #ArraySum(get_results1.q_count)#>
(This is giving me an error, saying the parameter is "1" and not an array)
Thanks in advance for any help!
My code:
<cfquery name="get_results1" datasource="xxx">
SELECT DISTINCT(q1), COUNT(q1) AS q_count FROM survey GROUP BY q1
</cfquery>
(This returns all unique records, and how many of each there are, I want a total so I can find %)
<cfset total = #ArraySum(get_results1.q_count)#>
(This is giving me an error, saying the parameter is "1" and not an array)
Thanks in advance for any help!