L
loyal2him
I am trying to take an average of five fields in a record and place the
result in a sixth field. I have tried various methods including DAvg
and AVG, but to no avail. The problem is that it needs to ignore null
fields. For instance, if Field1 has a value of 10, Field2 has a value
of 10, Field3 has a value of 10, Field4 and Field5 are null, the
average needs to be equivalent to (10 + 10 + 10)/3 NOT (10 + 10 +
10)/5. Any ideas?
I am trying to code this into a button on a form, but if it ends up
being run in a query, i am fine with that, it just needs to get done.
I tried AVG(Field1 + Field2 + Field3 + Field4 + Field5) in a query, but
it didn't give me an average, just a total.
result in a sixth field. I have tried various methods including DAvg
and AVG, but to no avail. The problem is that it needs to ignore null
fields. For instance, if Field1 has a value of 10, Field2 has a value
of 10, Field3 has a value of 10, Field4 and Field5 are null, the
average needs to be equivalent to (10 + 10 + 10)/3 NOT (10 + 10 +
10)/5. Any ideas?
I am trying to code this into a button on a form, but if it ends up
being run in a query, i am fine with that, it just needs to get done.
I tried AVG(Field1 + Field2 + Field3 + Field4 + Field5) in a query, but
it didn't give me an average, just a total.