miracleman
07-15-2008, 05:53 PM
Is is possible to do math calculations to fields in a query if the field name is change for an expression? Lets say a field names are hours and rate, and I use an expression for like Total Hours:hours and Hourly Rate:rate. then I would like to do something like [Total]:[Total Hours]*[Hourly Rate] but I'm getting an error saying that the [total hours] is not a valid field.
any help is appreciated.
Banana
07-15-2008, 06:16 PM
The expression should be something like:
ExpressionName: [FirstFieldName] * [SecondFieldName]
You can have any name (except for reserved words, of course) for the 'ExpressionName' but FirstFieldName and SecondFieldName must refer to a field in table and is spelt the right way.
Just use the underlying field names Total: [hours] * [rate]
miracleman
07-16-2008, 03:44 PM
the problem is that one of the fields is a SUM field (hours is realy sum of hours) and rate is a formula. there is no way to do the calculation if the fields are not actual fields in the table?
Banana
07-16-2008, 03:59 PM
Pretty sure you could do a Rate*Sum(Hours)....
In QBE, it would look like this:
HourRates: Rate*Sum([Hours])