AVG function on report failing

techexpressinc

Registered User.
Local time
Today, 02:53
Joined
Nov 26, 2008
Messages
185
I have a report abending today. The report field causing the abend is
"Avg(LF2FP2)"

I think the problem is a zero value in the field LF2FP2.

Attached is a screen print of the error. I know it is this field because I can remove it and the report works fine.

Does anyone have a suggestion for a simple fix?

Thank you
Russ
Rneuman @ scaninc.org
 

Attachments

  • Access Avg error 3-23-10.JPG
    Access Avg error 3-23-10.JPG
    17.6 KB · Views: 114
Re: query has a bad field going into report

#error is in the field - i think it goes back to the zero problem divide by zero

This formula needs fixed to acount for zero situations.

Hmm?
 

Attachments

  • AVG PBL FIELD.JPG
    AVG PBL FIELD.JPG
    13 KB · Views: 112
Have a look at the Nz function and set the return value to 1. Or maybe an IIF statetment might be it.
 
Re: the old divide by zero pbl was the root cause

the old divide by zero pbl was the root cause

I put this code in for a fix:
LifeTot2: IIf([LifeTot]>0,[LifeTot],1)

It seems to be good, so far.
Russ
 
Goodie. Glad you got that working.

Maybe someday, some Mathematician will be able to prove that you can divide numbers by 0 :)
 
Its your data and I'm sure that you know what it means when Lifetot=0 and therefore is =1 and >0.5, and that you infact don't have an error elsewhere.

Brian
 

Users who are viewing this thread

Back
Top Bottom