You can put the 'constant' in a query field:
MathProduct: [Field1] * 10 will multiply by 10.
upside: simple and easy
downside: can become a maintenance nightmare if you use it in a lot of
queries and then decide to change the value of the 'constant'. E.g. $ per
mile traveled.
or
you can have a table with one row, one field 'Constant' and use it to
multiply the values
MathProduct: [Field1]*[Constant]
Query:
SELECT Values.Value, [value]*[constant] AS Product
FROM [Values], Constant;
upside: easy to change the value of the constant
downside: another table to maintain.
or you can write a little function in code to provide the result.
Function MultiplyConstant (passedValue as double) as double
MultiplyConstant = nz(passedValue)* 10
End Function
Then in your query:
MathProduct:MultiplyConstant([Field1]) will give you the result you want.
Upside: fairly easy to maintain, just go into the function and change the
value of the constant.
Downside: some loss in performance due to having to 'calculate the value'
for each row using vba code.
Mess about with it for a while and you will have it figured out.
Ed Warren.
tina said:
the multiplier is a constant