Re: Access Rewrites SQL Incorrectly



On Sat, 01 Mar 2008 20:26:15 GMT, "Sky" <sky @ stanley associates .
com> wrote:

"David W. Fenton" <XXXusenet@xxxxxxxxxxxxxxxxxxx> wrote in message >> The
grouping order of A then B has been reversed, and the sort

Access is correct and you are WRONG.

In short, it's pilot error on your part, in that you didn't
correctly tell the query designer what you wanted.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

My understanding is that a Group By enforces a sort order, if no explicit
sort order is provided.

Where did you get that from? No ORDER BY, no guaranteed order of
records.


This is completely demonstrated by Access Jet, AS LONG AS you keep the query
in SQL View. The sort order is maintained according to the implied ordering
of the Group By clause, with A first then B, even if A is not displayed in
the Select clause.

So are you saying that Access Jet is wrong in its handling of the SQL? I
believe Access Jet engine handles the SQL correctly.

It is ONLY when you switch from SQL view to Design View, that suddenly the
Access design grid reinterprets the SQL differently. The changes occurs ONLY
on the instant of switching from SQL to design grid (QBE) view.

EITHER Access Jet is wrong on how it is handling the SQL, OR the Access
Design View is wrong on the design view presentation. They behave
differently.

Everything works fine as long as it all stays in the SQL view. Are you
arguing that Access and Jet handle the query incorrectly in SQL view?

Sounds to me like you are making such an argument.


- Steve

.



Relevant Pages

  • Re: Last 30 days in Query
    ... In order to do the last 30 entries, you would have to first decide on an order to sort your data. ... If you are asking "Where do I enter these SQL statements at?", you need to enter them in SQL view of the query. ... Design view, Datasheet view, and SQL view. ...
    (microsoft.public.access.queries)
  • RE: Counting expression doesnt work when sorted by count - Access 200
    ... However the following SQL script doesn't work. ... I rarely build my queries in SQL as I don't come from an SQL background. ... In design view the first query is as ... Sort - Descending ...
    (microsoft.public.access.queries)
  • Counting expression doesnt work when sorted by count - Access 200
    ... However the following SQL script doesn't work. ... In design view the first query is as ... Sort - Descending ...
    (microsoft.public.access.queries)
  • Re: SQL
    ... > If you design right, you can *shift* much behavior to being data and ... > SQL is close to being Turing Complete. ... It is a bad habit of yours. ... If you're seriously suggesting that CRUD applications are equal ...
    (comp.object)
  • Re: Object-oriented thinking in SQL context?
    ... away from arrays and other non-OO data structures associated ... SQL is constrained to 'trivial' arrays. ... Design: Logical Design", 4th edition. ... Something analogous happens with database design. ...
    (comp.databases.theory)