#1   Report Post  
Posted to microsoft.public.excel.misc
lee lee is offline
external usenet poster
 
Posts: 184
Default Parameter Query

I seem to be hitting a limit in the number of parameters Excel takes in
getting data. The query in MS Query does return records alright with four
parameters, but it will not return the data to the worksheet. It does fine
with only three parameters. The parameters are set to read specific cells in
the workbook.

I have modified the query by alternately hardcoding the parameters to see if
any one of them was the problem and the query returns data just fine....so
long as there are only three parameters. Any ideas?


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Parameter Query

You query may not be returning any data becasue there is no data that matches
all 4 filters.

I usually debug my queries using the query editor. The editor will show you
the data that matches the filters in real time and give you errors if your
sql has errors.

From excel 2003
Select a cell wherre data is returned using 3 filters
then from worksheet menu
Data - Import External Data - Edit query

Look for the SQL box and select. Modify the SQL as required and you will
see the items returned from the query. Change the SQL until you understand
the problem.

"Lee" wrote:

I seem to be hitting a limit in the number of parameters Excel takes in
getting data. The query in MS Query does return records alright with four
parameters, but it will not return the data to the worksheet. It does fine
with only three parameters. The parameters are set to read specific cells in
the workbook.

I have modified the query by alternately hardcoding the parameters to see if
any one of them was the problem and the query returns data just fine....so
long as there are only three parameters. Any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Parameter Query

You may need to assign an alias to the column name like below for it to work

SELECT Orders.OrderID AS Freight, Orders.Freight, [Freight]*1.1 AS [New
Freight] FROM Orders;

"Lee" wrote:

I get records in Query Editor. However, I have determined that there is not
a limit on the number of parameters. Instead, it appears that excel does not
like the use of parameters on two specific fields. I can use one of the
fields in conjunction with the other so long as one of them is hardcoded and
one is parameter.

Basically, the question now is why would I get records returned in Query
Editor but not returned in the excel worksheet...still working on the
problem. thanks.

"Joel" wrote:

You query may not be returning any data becasue there is no data that matches
all 4 filters.

I usually debug my queries using the query editor. The editor will show you
the data that matches the filters in real time and give you errors if your
sql has errors.

From excel 2003
Select a cell wherre data is returned using 3 filters
then from worksheet menu
Data - Import External Data - Edit query

Look for the SQL box and select. Modify the SQL as required and you will
see the items returned from the query. Change the SQL until you understand
the problem.

"Lee" wrote:

I seem to be hitting a limit in the number of parameters Excel takes in
getting data. The query in MS Query does return records alright with four
parameters, but it will not return the data to the worksheet. It does fine
with only three parameters. The parameters are set to read specific cells in
the workbook.

I have modified the query by alternately hardcoding the parameters to see if
any one of them was the problem and the query returns data just fine....so
long as there are only three parameters. Any ideas?


  #4   Report Post  
Posted to microsoft.public.excel.misc
lee lee is offline
external usenet poster
 
Posts: 184
Default Parameter Query

Joel, I had a select DISTINCT in my sql. It looks like that was the problem
although I don't understand why. I have removed the "distinct" command and
am now returning data into the worksheet. I appreciate your time on this.

"Joel" wrote:

You may need to assign an alias to the column name like below for it to work

SELECT Orders.OrderID AS Freight, Orders.Freight, [Freight]*1.1 AS [New
Freight] FROM Orders;

"Lee" wrote:

I get records in Query Editor. However, I have determined that there is not
a limit on the number of parameters. Instead, it appears that excel does not
like the use of parameters on two specific fields. I can use one of the
fields in conjunction with the other so long as one of them is hardcoded and
one is parameter.

Basically, the question now is why would I get records returned in Query
Editor but not returned in the excel worksheet...still working on the
problem. thanks.

"Joel" wrote:

You query may not be returning any data becasue there is no data that matches
all 4 filters.

I usually debug my queries using the query editor. The editor will show you
the data that matches the filters in real time and give you errors if your
sql has errors.

From excel 2003
Select a cell wherre data is returned using 3 filters
then from worksheet menu
Data - Import External Data - Edit query

Look for the SQL box and select. Modify the SQL as required and you will
see the items returned from the query. Change the SQL until you understand
the problem.

"Lee" wrote:

I seem to be hitting a limit in the number of parameters Excel takes in
getting data. The query in MS Query does return records alright with four
parameters, but it will not return the data to the worksheet. It does fine
with only three parameters. The parameters are set to read specific cells in
the workbook.

I have modified the query by alternately hardcoding the parameters to see if
any one of them was the problem and the query returns data just fine....so
long as there are only three parameters. Any ideas?


  #5   Report Post  
Posted to microsoft.public.excel.misc
lee lee is offline
external usenet poster
 
Posts: 184
Default Parameter Query

I get records in Query Editor. However, I have determined that there is not
a limit on the number of parameters. Instead, it appears that excel does not
like the use of parameters on two specific fields. I can use one of the
fields in conjunction with the other so long as one of them is hardcoded and
one is parameter.

Basically, the question now is why would I get records returned in Query
Editor but not returned in the excel worksheet...still working on the
problem. thanks.

"Joel" wrote:

You query may not be returning any data becasue there is no data that matches
all 4 filters.

I usually debug my queries using the query editor. The editor will show you
the data that matches the filters in real time and give you errors if your
sql has errors.

From excel 2003
Select a cell wherre data is returned using 3 filters
then from worksheet menu
Data - Import External Data - Edit query

Look for the SQL box and select. Modify the SQL as required and you will
see the items returned from the query. Change the SQL until you understand
the problem.

"Lee" wrote:

I seem to be hitting a limit in the number of parameters Excel takes in
getting data. The query in MS Query does return records alright with four
parameters, but it will not return the data to the worksheet. It does fine
with only three parameters. The parameters are set to read specific cells in
the workbook.

I have modified the query by alternately hardcoding the parameters to see if
any one of them was the problem and the query returns data just fine....so
long as there are only three parameters. Any ideas?


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
Parameter query in MS Query from Excel Jimbo Excel Discussion (Misc queries) 1 September 9th 09 04:27 PM
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
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
parameter query help marcus Excel Discussion (Misc queries) 0 September 30th 05 12:49 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 11:46 PM.

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"