#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default parameters

When I edit a query and insert parameters, I cannot save teh query because I
get the message: "Parameters are not allowed in queries that cannot be
displayed graphically". Does anyone know a way around this please?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default parameters

Can you isolate the probelm to a single parameter. Add only one parameter
and see which is causing the problem.

Each parameter may need to be on a new line in the SQL query editor

From ........
Where ..........


The Where needs to be on a seperate line than the FROm parameters.

"DavidC" wrote:

When I edit a query and insert parameters, I cannot save teh query because I
get the message: "Parameters are not allowed in queries that cannot be
displayed graphically". Does anyone know a way around this please?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default parameters

I only have one parameter. My code begins:
DECLARE @PONUM char(8)
SET @PONUM = ?
SELECT @PONUM, field 2, field 3, etc......

If line 2 is:
SET @PONUM = 'PO123456'
then the query runs.
But I want to be able to pass the @PONUM from the Excel spreadsheet and so I
have used SET @PONUM = ?
For other reasons, the query will not display graphically and the error
message I get is that I cannot use parameters with a query that does not
display graphically. Does anyone know a way around this strange restriction
in MS Query?


"Joel" wrote:

Can you isolate the probelm to a single parameter. Add only one parameter
and see which is causing the problem.

Each parameter ma' y need to be on a new line in the SQL query editor

From ........
Where ..........


The Where needs to be on a seperate line than the FROm parameters.

"DavidC" wrote:

When I edit a query and insert parameters, I cannot save teh query because I
get the message: "Parameters are not allowed in queries that cannot be
displayed graphically". Does anyone know a way around this please?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default parameters

I f you record a macro using a fixed value then I can easily modify the query
to get a value from the spreadsheet.

"DavidC" wrote:

I only have one parameter. My code begins:
DECLARE @PONUM char(8)
SET @PONUM = ?
SELECT @PONUM, field 2, field 3, etc......

If line 2 is:
SET @PONUM = 'PO123456'
then the query runs.
But I want to be able to pass the @PONUM from the Excel spreadsheet and so I
have used SET @PONUM = ?
For other reasons, the query will not display graphically and the error
message I get is that I cannot use parameters with a query that does not
display graphically. Does anyone know a way around this strange restriction
in MS Query?


"Joel" wrote:

Can you isolate the probelm to a single parameter. Add only one parameter
and see which is causing the problem.

Each parameter ma' y need to be on a new line in the SQL query editor

From ........
Where ..........


The Where needs to be on a seperate line than the FROm parameters.

"DavidC" wrote:

When I edit a query and insert parameters, I cannot save teh query because I
get the message: "Parameters are not allowed in queries that cannot be
displayed graphically". Does anyone know a way around this please?

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
Too few parameters Laebrye Excel Discussion (Misc queries) 1 May 26th 09 11:56 AM
SQL & Like Parameters George Applegate[_2_] Excel Discussion (Misc queries) 2 November 2nd 07 06:11 PM
Solver not following parameters Homer Excel Worksheet Functions 0 May 25th 07 04:17 AM
Too few parameters lou sanderson Excel Discussion (Misc queries) 1 January 13th 06 06:35 PM
too few parameters lou sanderson Excel Discussion (Misc queries) 1 December 14th 05 07:53 PM


All times are GMT +1. The time now is 12:38 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"