Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 93
Default ODBC parameter query fails with HAVING

The following applies to Excel/MSQuery 2000 and 2003. Not tested yet on 2007.

If a query through Excel (via MSQuery) attempts to use a parameter when a
GROUP BY is required, the query uses a HAVING clause (even though it may not
be required) and is submitted to the ODBC connection without prompting the
user for the variable thus failing to execute.

The fail point is on the HAVING clause. I can run queries with GROUP BY,
changing the HAVING to a WHERE as long as the filter is not on the SUM (or
any aggregation).

Now HAVING should only be used on SUM (aggregations) as this is a very
inefficient filter, but even so, it does not work. As far as I can see,
there is no way to get a filter on a SUM to work properly via an ODBC
connection to a non-Microsoft database.

Cheers,
Stephanie.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 93
Default ODBC parameter query fails with HAVING

UPDATE: This also fails using a Microsoft database (used Access).

Hey Microsoft guys, if there is a work-around, please let me know.
Otherwise the utility of using Excel is greatly diminished on this project I
am doing.


"Stephanie" wrote:

The following applies to Excel/MSQuery 2000 and 2003. Not tested yet on 2007.

If a query through Excel (via MSQuery) attempts to use a parameter when a
GROUP BY is required, the query uses a HAVING clause (even though it may not
be required) and is submitted to the ODBC connection without prompting the
user for the variable thus failing to execute.

The fail point is on the HAVING clause. I can run queries with GROUP BY,
changing the HAVING to a WHERE as long as the filter is not on the SUM (or
any aggregation).

Now HAVING should only be used on SUM (aggregations) as this is a very
inefficient filter, but even so, it does not work. As far as I can see,
there is no way to get a filter on a SUM to work properly via an ODBC
connection to a non-Microsoft database.

Cheers,
Stephanie.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc

Reply
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
How to choose if I use a parameter or not in a parameter query Arnaud Excel Discussion (Misc queries) 0 March 8th 07 01:19 PM
How to put a parameter into an Excel Query Richard Excel Discussion (Misc queries) 1 January 6th 06 01:41 PM
parameter query help marcus Excel Discussion (Misc queries) 0 September 30th 05 12:49 PM
Parameter Query? AcesUp Excel Discussion (Misc queries) 2 August 22nd 05 10:32 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM


All times are GMT +1. The time now is 05:11 AM.

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

About Us

"It's about Microsoft Excel"