LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default SQL - As part of an aggregate function ERROR

Thanks! I tried over and over with different forms. Until I stopped using
the alias, it would not work. Now I understand. Thanks again, this should
help with other potential issues.

Dave


"onedaywhen" wrote:


dave k wrote:
The thing I can't do is replace the GROUP BY with fchar. I must
use GROUP BY MID(F1,1,1). Is this because fchar is not defined yet

when the
SQL statement is performed?


According to the ANSI specs what *should* happen is that when a column
alias is used in the SELECT clause, that alias is the *only* way of
referring to the column/expression (e.g. in the ORDER BY and GROUP BY
clauses) because the underlying tables should not be subsequently used
i.e. the newly-build cursor should be used instead.

Jet patently does not follow the spec because the opposite is true i.e.
you cannot use the alias, you have to use the original column name (or
full expression) and this usage should be illegal. [I'm not sure how
Jet works under the covers but perhaps it cannot optimize the
expression so it *must* go back to the original tables?]

So you *should* be able to use the alias but with Jet SQL you can't.
FWIW SQL Server is similarly non-compliant [and is similarly file-based
under the covers].

Jamie.

--


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aggregate tables nc Excel Discussion (Misc queries) 0 September 12th 08 03:35 PM
Aggregate Unique part no in cells to sum qty Marty Marshfield Excel Discussion (Misc queries) 4 September 20th 07 02:06 AM
how do I aggregate dates Johnopp Excel Discussion (Misc queries) 5 March 5th 06 10:26 PM
aggregate calculations [email protected] Excel Discussion (Misc queries) 0 May 26th 05 04:32 PM
How to aggregate in Excel? Frank Krogh Excel Programming 1 March 4th 04 02:31 PM


All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"