Received: from post.mail.demon.net (post-20.mail.demon.net [194.217.242.27]) by hub.org (8.8.8/8.7.5) with SMTP id RAA08050; Tue, 12 May 1998 17:01:24 -0400 (EDT) Received: from nthfen.demon.co.uk ([194.222.28.133]) by post.mail.demon.net id aa2020638; 12 May 98 20:48 GMT Received: by nthfen.demon.co.uk with esmtp (Exim 1.82 #5) id 0yZ9ya-0004vH-00; Tue, 12 May 1998 08:59:52 +0100 Reply-To: tony@nthfen.demon.co.uk MMDF-Warning: Parse error in original version of preceding line at post.mail.demon.net From: Tony Cowderoy To: daveh@insightdist.com, fozztexx@talia.hq.vxn.com, pgsql-hackers@postgresql.org, pgsql-interfaces@postgresql.org MMDF-Warning: Parse error in original version of preceding line at post.mail.demon.net Subject: Re: [INTERFACES] Group/Order by not in target - Was [NEW ODBC DRIVER] Date: Tue, 12 May 1998 09:01:57 +0100 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1161 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-Id: I have hit the Access 97 problem of ORDER BY not in target list with a simple, one-table query. The problem does not seem to have anything to do with joins. I have logged the SQL sent to the back end with the CommLog option in the 238 driver (very useful, thanks Byron). When using ORDER BY, Access 97 first sends a query to retrieve just the key(s) and then sends another to get the required data. Hence, for the first query unless the fields used in ORDER BY are key fields they are not in the target list. Nice one MS! Nothing like making your software do the obvious thing, is there? There is a work around. First create your query the usual way (point and click if you like). Next, display the SQL. Finally, convert it into a PASSTHROUGH query, so that the backend receives your SQL as written. This worked for my very simple test, but I have not checked it out for more complex queries. BTW, Access 2.0 does not seem to have this problem, so why this strange behaviour has been introduced into 97 I cannot imagine. Tony Cowderoy