specify the column name that you're trying to SUM

On Jan 1, 2008 9:55 AM, morchella <[EMAIL PROTECTED]> wrote:
> ok not sure what i am doing wrong
> in my out put it does the count just fine, but i cant get it to SUM up the
> totals.
>
> error:
> [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near '*'.
>
>
> <cfquery datasource="myBD" name="get_totals">
>     Select Count(*) AS total,
>     SUM(*) AS Sumtotal
>     From employees
>     WHERE emp_assigned = #get_Emp.usr_id#
> </cfquery>
>
> name value
> p1 25
> p2 30
> p3 10
>
> totalvalue should be 65
>
>
> 

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

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295643
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to