Ah, right QoQ can be bitchy. Can't you alias the column names in the initial
query?

SELECT my1990 = [1990], my1991 = [1991]
or
SELECT [1990] as my1990 etc etc

That way can reference them without any issues.

P.S. 1990 and the like are absolutely horrible column names.

On Wed, Jun 9, 2010 at 11:41 AM, fun and learning
<[email protected]>wrote:

>
> >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 <[email protected]
> >wrote:
> >
> >>
>
> I get the following error when I use quotes
> Query Of Queries syntax error.
> Encountered "SUM. Lexical error at line 0, column 0. Encountered: "\""
> (34), after : "
>
> and the following error when I use brackets
> Query Of Queries syntax error.
> Encountered "SUM ( [. Incorrect Select List
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:334414
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to