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,
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
] 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
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
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,
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