Right... but you are actually converting TO a numeric type at runtime. This
is done PRIOR to the "SUM" function. Ergo - sum( ) cannot handle a char
datatype.

-----Original Message-----
From: Alan Ford [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 13, 2003 10:23 AM
To: CF-Talk
Subject: Re: Quick SQL Sum Question


>To use SUM( ) the column in question MUST be numeric type (int, decimal,
> float etc).

It doesn't have to be - this works (as long as all the rows can be cast) -

select sum (cast(Value as decimal)) as val

Regards,

Alan Ford



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to