I'd recommend either doing it in your Stored Procedure or creating a function to handle it. You don't want to be putting that expression in every sell in which you're doing division.
You can create a function like the one below and place it in the Report code block or put it in an assembly and reference the assembly in the report.
Public Function CalcAvg(dblNum As Double, dblDen As Double) as Object
if (dblDen = nothing) or (dblDen = 0) CalcAvg = 0 else CalcAvg = dblNum / dblDen end if
Just in case anyone is reading this now, I wanted to mention that the following statement does NOT work as intended: =iif(value1 = 0 or value2=0,0, value1/value2) This statement will bomb out if value2 = 0 with a DIV/0 error before even reaching the disjunction. I assume this is because of the fact that lines of code are mathematically interpreted from right-to-left, instead of how we normally think about them. The other suggestions for custom code (where the conditional is broken down into separate lines) are the appropriate solutions.