math inside the query

miracleman

Registered User.
Local time
Today, 12:41
Joined
Aug 9, 2007
Messages
10
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.
 
The expression should be something like:

Code:
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]
 
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?
 
Pretty sure you could do a Rate*Sum(Hours)....

In QBE, it would look like this:

Code:
HourRates: Rate*Sum([Hours])
 

Users who are viewing this thread

Back
Top Bottom