As a new query against the database:

<cfquery name="q" datasource="myDSN">
    Select    sum(invoiceamount)
    From      invoices   
</cfquery>

Or

<cfquery name="q" dbtype="query">
    Select    sum(invoiceamount)
    From      123   
</cfquery>

Where 123 is the previous query.

Paul.



-----Original Message-----
From: Rick Sanders [mailto:[email protected]] 
Sent: Tuesday, February 24, 2009 12:46 PM
To: cf-newbie
Subject: Sum


It's a newbie question so I'm posting it here.

 

I've looked through the documentation and can't find it. How do I sum a
column from a query?

 

Ex:

 

<cfoutput query=123>

#invoiceamount#

</cfoutput>

 

Is there a sum function like: #sum(invoiceamount)# or anything like that?

 

Thanks,

 

Rick Sanders

Webenergy

Canada: 902-431-7279

USA:       919-799-9076

Canada: www.webenergy.ca

USA:       www.webenergyusa.com

 







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4395
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to