What is wrong in this rdlc expression. When ever the difference is zero it throws error

354 views Asked by At
=iif(Sum(Fields!ClsRead.Value)-Sum(Fields!OpnRead.Value)=0,"NO HSD Supplied",sum(Fields!HSDIssued.Value)/(Sum(Fields!ClsRead.Value)-Sum(Fields!OpnRead.Value)))
1

There are 1 answers

0
tezzo On BEST ANSWER

Using IIf you have to remember that both side (TruePart and FalsePart) are always evaluated so dividing by 0 raise an #Error.

You can use custom code (right click design surface outside report > Report Properties > Code) and replace IIf with an If/Then/Else.