RE: [ACFUG Discuss] Sum/CFSET

2006-09-22 Thread axunderwood
To answer the first question, you can get rid of the "" problem with: cfset mySum = Val(var1) + Val(var2) + Val(var3) If the var is null or empty, Val() will change it to 0 If you want to accomplish the same via SQL, try: SELECT mySum= ISNULL(col1, 0) + ISNULL(col2, 0) + ISNULL(col3,

RE: [ACFUG Discuss] Sum/CFSET

2006-09-22 Thread Chris C. Cooper
Atlanta, Georgia 404.691.4816 Cooper e.business Solutions - http://www.cooperebusiness.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dean H. Saxe Sent: Thursday, September 21, 2006 11:26 PM To: discussion@acfug.org Subject: Re: [ACFUG Discuss] Sum/CFSET

Re: [ACFUG Discuss] Sum/CFSET

2006-09-22 Thread Dean H. Saxe
] On Behalf Of Dean H. Saxe Sent: Thursday, September 21, 2006 11:26 PM To: discussion@acfug.org Subject: Re: [ACFUG Discuss] Sum/CFSET SUM requires a group by clause. SELECT sum(column_name) as sum_value FROM Table GroupBy column_name -dhs Dean H. Saxe, CISSP, CEH [EMAIL PROTECTED] [T]he

[ACFUG Discuss] Sum/CFSET

2006-09-21 Thread Chris C. Cooper
Ive got a table with some fields Im writing numeric values to from a form. I have the Columns in the database (SQL 2005) as Numeric fields. Ive tried to sum the totals in SQL using SUM(value1, value2, value3, value4, value5) as total, but I kept getting errors about having to add all

Re: [ACFUG Discuss] Sum/CFSET

2006-09-21 Thread Dean H. Saxe
SUM requires a group by clause. SELECT sum(column_name) as sum_value FROM Table GroupBy column_name -dhs Dean H. Saxe, CISSP, CEH [EMAIL PROTECTED] [T]he people can always be brought to the bidding of the leaders. This is easy. All you have to do is to tell them they are being attacked,

Re: [ACFUG Discuss] Sum/CFSET

2006-09-21 Thread Douglas Knudsen
righto, but I took his description to mean he wanted to sum columns, not rows.DKOn 9/21/06, Dean H. Saxe [EMAIL PROTECTED] wrote:SUM requires a group by clause.SELECT sum(column_name) as sum_value FROM Table GroupBy column_name -dhsDean H. Saxe, CISSP,CEH[EMAIL PROTECTED][T]he people can always