This content has been marked as final. Show 4 replies
Do you know how to select aggregates, such as count, sum, min, max, and avg in sql? All that works either in your original query, or with query of queries.
The second sum is off because the counter is initialized in the wrong place.
Move <CFSET counter = 0> to just before the second <CFOUTPUT> tag.
Then get rid of these lines:
<CFLOOP QUERY="project_hours" STARTROW="#NewCount#" ENDROW="#CURRENTROW#">
<CFSET counter = counter + #Hours#>
Thank you MikerRoo - As soon as I read your message it made perfect sense. The sum of total hours across all projects works - I am multiplying the rate X Hours and I get the Project totals and this works However I am trying to sum all of the Project totals and this is not working.
The total should be 4375 however it is returning 3140 it is off by 1235. Any help would be greatly appreciated.
Forget about the array math.
Use this kind of logic: