Query secondary calculation reference to query's own calculated field?

G

G Lykos

Greetings! Have a select query that has a field calculated from incoming
fields from a table. I then pick up that calculated field and use it in a
second calculated field.

When the query is executed, I get a parameter entry prompt for the
calculated field name, in response to which I just hit enter, and the query
executes properly. It would appear that the query figures out during
execution that the first calculated expression needed as input to the second
expression is in fact available, and uses it, even though it asked for it up
front.

Question: is there a way via some syntax to construct the query references
in this situation such that the query understands at the beginning of
execution that it doesn't need to prompt for parameter entry?

I discovered through experimentation that I can stack select queries, having
the first generate the first calculated field, then have the second query
read in the first and calculate the second field, and not see the parameter
entry prompt. The interest is in condensing this down to one query.
Grasping at straws, I tried a "me.parameter" syntax, and while perhaps
creative, the query processor wasn't amused.

Thanks for ideas!
George
 
D

Duane Hookom

I try to avoid using a calculated field name in other expressions. You can
copy the calculation in place of the alias.
 

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