Enter Parameter Value in Query

T

tamit

Every query expression that I write using results from other expression
requests "Enter Parameter Value" . Yet, I do not want to enter a parameter
value, I want to use the results of the expression. If I hit "ok" the
results show correctly. But in one query I am building on to my expressions
column by column and therefore it asks for "Enter Parameter Value" on each
one.

How do I get rid of this? I have read several other posting about this
topic, but none seem to apply to this expression. I realize it might be part
of my expression building because it is consistent for every expression I
build. Am I naming something incorrectly or have incorrect syntax?


For Example is asking for Parameter values for each one of these fields: Sum
of Amps, Ratio of Total Amps, Total Cost HVAC LH Improv, Total Cost Elec LH
Improv

Here is SQL:
SELECT DISTINCTROW [Equipment List].[Process Step], Sum([Equipment
List].Amps) AS [Sum Of Amps], [Total Amps Calculation].[Total Amps], ([Sum Of
Amps]/[Total Amps Calculation]![Total Amps]) AS [Ratio of Total Amps],
([Ratio of Total Amps]*6451899) AS [Total Cost HVAC LH Improv], ([Ratio of
Total Amps]*4676828) AS [Total Cost Elec LH Improv], ([Total Cost HVAC LH
Improv]+[Total Cost Elec LH Improv]) AS [LH Improv by Amps], ([LH Improv by
Amps]/7) AS [Annual Deprec LH Improv by Amps]
FROM [Equipment List], [Total Amps Calculation]
GROUP BY [Equipment List].[Process Step], [Total Amps Calculation].[Total
Amps], ([Sum Of Amps]/[Total Amps Calculation]![Total Amps]), ([Ratio of
Total Amps]*6451899), ([Ratio of Total Amps]*4676828), ([Total Cost HVAC LH
Improv]+[Total Cost Elec LH Improv]), ([LH Improv by Amps]/7);
 
K

KARL DEWEY

Each of these are an alias name of a calculated field. You in turn use them
in a calculation. Access is picky about trying to use an alias in a
calculation BEFORE it has made the calculation for the alias.
The best way is to use a second query to do the further calculation.

I have not tested this theory but it seem that Access does the calculations
from bottom-up -- so if the creation of the alias is toward the end of the
SQL statement and the alias is used near the beginning then it works.
 

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