0

I am using the following expression in one of my reports:

=Iif(fields!occ.Value=0,0,Sum(Fields!RIemps.Value) / Sum(Fields!occ.Value))

The calculation is working for some of the fields but not for others. When I replace the second "0" with Sum(Fields!occ.Value) then the occupancy works and the calculation runs as it should providing the occupancy value as stated:

=Iif(fields!occ.Value=0,Sum(Fields!occ.Value),Sum(Fields!RIemps.Value) / Sum(Fields!occ.Value))

When I reverse the query, the fields which were working do not and the the ones that were not, now work:

=Iif(fields!occ.Value=0,Sum(Fields!RIemps.Value) / Sum(Fields!occ.Value),0)

I cannot get all fields to work consistently, it is either one or the other. Any thoughts on what might be triggering the inconsistency in the expression?

  • This does not look like SQL. What kind of tool or database is that? –  Jul 27 '15 at 14:45
  • possible duplicate of [SSRS Expression Divide by Zero Error](http://stackoverflow.com/questions/19189132/ssrs-expression-divide-by-zero-error) – tezzo Jul 27 '15 at 14:48

0 Answers0