You need to alias the result of the aggregate function.

<cfquery name="exlunch" datasource="#application.dsn#" dbtype="ODBC">
SELECT      SUM(racedaylunch) as LunchSum
FROM         thelist
</cfquery>


<cfoutput>#LunchSum#</cfoutput>

----- Original Message -----
From: "Jeff Fongemie" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, June 25, 2001 12:09 PM
Subject: help using sql sum function


Hello cf-talk,

Why the heck is this throwing an error? "Expression result cannot be
converted to a string"

<cfquery name="exlunch" datasource="#application.dsn#" dbtype="ODBC">
SELECT      SUM(racedaylunch)
FROM         thelist
</cfquery>


<cfoutput>#exlunch#</cfoutput>


Best regards,
 Jeff Fongemie                          mailto:[EMAIL PROTECTED]
------------------------
Internet Guns For Hire
(603) 356-0768
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to