-----Original Message-----
If you are trying to do this in a single query, you will have to spell
each Expression explicitly. You cannot refer to a computed column as
a parameter in another column in a single query. You can, however,
reenter the equation that gave you that value.
If Expr2 is defined as A + B, and Expr3 is defined as A*B then
you would replace Expr1: = (0.25 * [Expr2]) + Expr3
with Expr1: = (0.25 * (A+B)) + (A*B)
Or, you could create one query that defines a set of the expressions
that do not refer to any other computed columns, then create a second
query that uses the computed columns from the first query to get those
expressions.
Or, another way would be to create functions that do all of the
intermediate calculations. Then all you would need to do is pass the
values to the functions and use those. My guess is that this would be
slower than the 2nd option, since that option would compute all of the
first set of Expressions and could be reused without having to
recalculate their values. Using a function would require that the
function be reevaluated each time it is used, so if you use Expr2, 4
times in subsequent expressions, then it would have to be computed 4
times.
Public fnExpr2(A as variant, B as Variant) as Variant
fnExpr2 = A + B
End function
Public fnExpr3(A as Variant, B as Variant) as Variant
fnExpr3 = A * B
End function
SELECT (0.25 * fnExpr2([field1], [field2])) + fnExpr3 ([field4],
[field5]) as Expr1
--
HTH
Dale Fye
I am trying to prevent Access accuracy from providng me
with a quotient value that is made up of background
calulated variables:
i.e. I need the literal values to be used for the quotient
calculation.
e.g. EXPR1
0.25*[EXPR2])+[EXPR3], then using EXPR1:
EXPR5=[EXPR1]/[EXPR4] where EXPR4 is also a derived
expression. I need the literal values, say 1509.63 and
2390.49 to be used that are the literal results of ExPR1
and EXPR4.
.