Expression in query

R

Radhika

I am trying to create a query form another query which takes the sum of two
fields and the count of a third. The query I am trying to create should add
the 'sum' fields and divided the result by the 'count' field. Below is my
expression:

Average: (([SumOfProcedures non-time based]+[SumOfTime Based
Units])/[CountOf# Hours Worked])

However, I get' #Error' as my result. This does not happen if i simply add
the 'sum fields':
([SumOfProcedures non-time based]+[SumOfTime Based Units])

What am I doing incorrectly?

Thank you,
Radhika
 
J

Jerry Whittle

If [CountOf# Hours Worked] is a null value or 0, that will cause problems. A
zero will cause a divide by zero error.

Also if [CountOf# Hours Worked] isn't an exact match, that will cause an
error, but probably the #Name error. Try running the query with just
[CountOf# Hours Worked] in the field and sort so that you can see if it
returns records without an error and what records are returned both on the
high and low end to ensure no 0 or nulls.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top