ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   parameters (https://www.excelbanter.com/excel-discussion-misc-queries/245240-parameters.html)

DavidC

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?

joel

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?


DavidC

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?


joel

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?



All times are GMT +1. The time now is 08:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com