We help IT Professionals succeed at work.

Divide by Zero Error in SSRS

December2000
December2000 used Ask the Experts™
on
Hi Experts,

How do I rewrite this expression to allow for divide by zero errors?


=iif( Fields!SERVICE_QTY.Value > 0 and Fields!BILLSEPARATE.Value= -1, round(Fields!TOTALNETPRICE.Value,2)/round(Fields!SERVICE_QTY.Value,2),Fields!TOTALNETPRICE.Value)

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sr. BI  Developer
Commented:
Hi,
Please check that blog post
http://asqlb.blogspot.com/2011/02/end-of-my-ssrs-nan-misery-avoid-ssrs.html

=iif( Fields!SERVICE_QTY.Value > 0 and Fields!BILLSEPARATE.Value= -1, round(Fields!TOTALNETPRICE.Value,2)/IIf(round(Fields!SERVICE_QTY.Value,2))=0,1,Fields!TOTALNETPRICE.Value)

Open in new window

Author

Commented:
Thank you!