parameters

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?
 
J

Joel

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.
 
D

DavidC

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?
 
J

Joel

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top