ArraySum
Hi,
with the code below, i got the result displayed in the table below. I want the total for all, but my code gave me the wrong total 10 instead of 15. Can any of you tell me why?
Thanks
<cfloop query="getNames">
<cfquery name="countCode" datasource="#request.dsn#">
Select count(i.Identifier) as totalRecs
FROM name
WHERE name_code = '#getNames.name_code#'
</cfquery>
<tr>
<td>#getNames.name#</td>
<td>#countCode.totalRecs#</td>
<cfset NumberArray = ArrayNew(1)>
<cfset Temp = Arrayprepend(NumberArray,countCode.totalRecs)>
</tr>
</cfloop>
<tr>
<td>Total All</td>
<td>#ArraySum(NumberArray)#</td>
</tr>
| Name | Count |
|---|---|
| Gas | 0 |
| Tanks | 0 |
| Radiations | 5 |
| Medical | 0 |
| Personal | 0 |
| Fax | 10 |
| Total | 10 |
