Make Parameter available for querie based report

S

Steve Roberts

I need to use a parameter to enter a date in the following query. I want the
Parameter to also be available for a report that's based on this query. When
I use this query, it prompts me twice instead of just using the [Enter Start
Date] AS StartDate parameter that I already entered.

Any ideas?

Thanks Steve

SELECT Manhole_ID.Last_Maintenance_Date, Manhole_ID.Diameter, [Enter Start
Date] AS StartDate

FROM Manhole_ID

WHERE (Manhole_ID.Last_Maintenance_Date > StartDate);
 
D

Duane Hookom

Have you tried:
SELECT Manhole_ID.Last_Maintenance_Date, Manhole_ID.Diameter,
[Enter Start Date] AS StartDate
FROM Manhole_ID
WHERE (Manhole_ID.Last_Maintenance_Date > [Enter Start Date]);
 
M

Michel Walsh

Hi,


In Jet, the WHERE clause cannot recuperate aliases defined in the SELECT
clause. Try

WHERE (Manhole_ID.Last_Maintenance_Date > [Enter Start Date]);


Hoping it may help,
Vanderghast, Access MVP
 
S

Steve Roberts

Thanks guys that fixed it.

It was so easy I couldn't see it!



Michel Walsh said:
Hi,


In Jet, the WHERE clause cannot recuperate aliases defined in the SELECT
clause. Try

WHERE (Manhole_ID.Last_Maintenance_Date > [Enter Start Date]);


Hoping it may help,
Vanderghast, Access MVP


Steve Roberts said:
I need to use a parameter to enter a date in the following query. I want
the Parameter to also be available for a report that's based on this
query. When I use this query, it prompts me twice instead of just using
the [Enter Start Date] AS StartDate parameter that I already entered.

Any ideas?

Thanks Steve

SELECT Manhole_ID.Last_Maintenance_Date, Manhole_ID.Diameter, [Enter
Start Date] AS StartDate

FROM Manhole_ID

WHERE (Manhole_ID.Last_Maintenance_Date > StartDate);
 

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