parameters

  • Thread starter Thread starter DavidC
  • Start date Start date
D

DavidC

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?
 
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.
 
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?
 
I f you record a macro using a fixed value then I can easily modify the query
to get a value from the spreadsheet.
 
Had the very same problem. Try putting your SQL into a stored procedure and call the sp from MS Query with dynamic parameters.
 
Back
Top