Ask a Question related to Coldfusion Database Access, Design and Development.
-
nav1 #1
Column Totals
Is there an easy way to total a column of numbers returned in a query? For
example, I am producing a sales report for 10 sales people. The database query
returns 10 rows, each with a sales amount. I need to compute a total of those
10 amounts. I am currently re-querying the database without a 'group by'
clause to get the total amount. It seems like there should be a CF function to
get that number without an additional query.
nav1 Guest
-
datagrid column calculate totals
Hi - hope someone can help with this datagrid issue - I think it's just a small bit of code I've got to tweak. Might be some useful information to... -
Looping through all rows and columns (to get sub-totals for each column and row)
Is there a way to loop through all rows and columns in order to fill a sub-totaled columns and a sub-totaled row (footer). I thought about doing... -
NEWBIE - Column Totals in Footer of mxDataGrid
Greetings, How can I display the total of one or several columns in the footer of an MxDataGrid? If there is a link to a tutorial or article,... -
ASP totals and sub-totals from an Access or SQL DB
Hi All I know I posted a similar topic a few days ago, but I may have gone on a bit of a rant with it. Basically I want to know if it is... -
totals at the TOP?
Is there any way to get FooterText to show at the top of the grid instead of the bottom? We have hundreds of pages of grids that are almost always... -
-
Scott*e #3
Re: Column Totals
<CFSET VARIABLES.TOTAL = 0>
<CFOUTPUT QUERY="MYQUERY">
<CFSET VARIABLES.TOTAL = VARIABLES.TOTAL + MYQUERY.FIELDNAME>
.. display fields as normal
</CFOUTPUT>
<CFPOUTPUT># VARIABLES.TOTAL#</CFOUTPUT>
Scott*e Guest
-
mxstu #4
Re: Column Totals
And another method ...
<cfset grandTotal = ArraySum(ListToArray(ValueList(yourQuery.SalesAmou ntColumn)))>
mxstu Guest



Reply With Quote

