Dividing two number in a query...HELP

  • Thread starter Thread starter RichK
  • Start date Start date
R

RichK

I have a query that returns 2 values that are sums.

I need to divide these two numbers and show the results in the query.

One field is the sum of service calls made and the other is the sum of the
dollars generated by those calls. I need to divide them for an average cost
per call.

Thanks in advance for any help !

Rich K
 
Hi Rich

I would suggest a second query based on your already existing query and add a third field like

Average: (sum of calls) / (sum of dollars

HTH
Bernd
 
RichK said:
I have a query that returns 2 values that are sums.

I need to divide these two numbers and show the results in the query.

One field is the sum of service calls made and the other is the sum
of the dollars generated by those calls. I need to divide them for an
average cost per call.

Thanks in advance for any help !

Rich K

Assuming your query is already a totals query, so that you can get
Sum(ServiceCalls) and Sum(Dollars), then you can have a third calculated
field:

CostPerCall: IIf(Sum(ServiceCalls)=0, 0, Sum(Dollars) /
Sum(ServiceCalls))

The IIf function is used to avoid an error if there were no calls.
 
Back
Top