I am still getting this error. This is my formula:
=iif(ReportItems!BUDMTD_2.Value=0,0,ReportItems!MTDChange_2.value/ReportItems!BUDMTD_2.Value)
This works in another report but not here.IIF is a function call. Therefore all arguments get evaluated before IIF is
called and you see a division by zero.
Possible solutions can be:
1) Avoid 0 in divisor (consider
=iif(ReportItems!BUDMTD_2.Value=0,0,ReportItems!MTDChange_2.value /
iif(ReportItems!BUDMTD_2.Value = 0, 1,ReportItems!BUDMTD_2.Value ))
2) Write VB function SafeDivide (A,B) and call it when needed (search
"SafeDivide" in this group)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"David" <David@.discussions.microsoft.com> wrote in message
news:2FC621DF-8C78-480F-A9E6-512A438B75B5@.microsoft.com...
>I am still getting this error. This is my formula:
> =iif(ReportItems!BUDMTD_2.Value=0,0,ReportItems!MTDChange_2.value/ReportItems!BUDMTD_2.Value)
> This works in another report but not here.|||David,
just in case it helps...I got so tired of writing statements like this
and trying to test them (because you finish up writing a lot of them)
that I wrote my division routines into a custom assembly and called the
custom assembly...the custom assembly then gives me much more control
over how I deal with bad data in calculations...
Peter
www.peternolan.com
No comments:
Post a Comment