Board index » delphi » SQL using SUM aggregate function

SQL using SUM aggregate function

Has anyone had any luck using "SUM" in an SQL query. My SQL
looks like this....

 SELECT SUM(FLD_NAME)
 FROM TABLE
 WHERE TABLE_KEY = :key

When I activate the query I get an error saying....

     Field "SUM of FLD_NAME" not found

Any ideas/examples would be appreciated cause I'm stumped.

--
Robert Case
Certified Netware Engineer (CNE)
Home http://www.teleport.com/~rcase/

 

Re:SQL using SUM aggregate function


In article <43atuf$...@maureen.teleport.com>, rc...@teleport.com says...

Quote

>Has anyone had any luck using "SUM" in an SQL query. My SQL
>looks like this....

> SELECT SUM(FLD_NAME)
> FROM TABLE
> WHERE TABLE_KEY = :key

>When I activate the query I get an error saying....

>     Field "SUM of FLD_NAME" not found

>Any ideas/examples would be appreciated cause I'm stumped.

You need to surround the field name with quotes.  You may also need the table
reference prefixing the field name.

Todd
--
=======================================================
Todd Fast
"His mind is somewhat too much taken up with his mind." - John Earle
Author of ReportLink, Paradox automation and report printing
component for Delphi.
=======================================================

Other Threads