Your first issue is that that is not a good db practice naming columns as
numbers.  If you put a prefix of "y" in front of the column name in your
table (or whatever you chose, i.e y1990, y1991, y1992) it wouldn't have this
issue, it would force your SQL to actual look for a table column rather than
just summing the number you entered.  In some databases you can force the
issue by surrounding the column header in quotations (Sum('1990')) but you
cannot count on that, you are better off renaming your column headers as I
said earlier.

Jim Eisenhauer


On Wed, Jun 9, 2010 at 8:27 AM, fun and learning <funandlrnn...@gmail.com>wrote:

>
> HI All -
>
> I have a query which returns the result set like below. The column names
> are like 1990, 1991, 1992 and there are certain amount for each year
>
> 1990 1991 1992
> 1000 5000 6000
> 2000 2000 3000
>
> I have a query of query which finds the sum of the amounts for year 1990,
> and I use the query like Select SUM(1990), it returns the sum of 1990+1990.
> How to make sure that 1990 is recognized as a column instead as a number.
>
> Thanks
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334411
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to