• Increase font size
  • Default font size
  • Decrease font size
Home Reporting Services Divide by zero / divide by 0 error #

Divide by zero / divide by 0 error #

E-mail Print
(0 votes)
Dividing by 0 is not allowed in Reporting Services / SQL Server. With this simple formula you can avoid divide by 0 so that the # Error message no longer appears in your report:
  SUM ( Fields!OmzetVorigJaar. Value )  + 0 = 0 , Nothing, = IIF (SUM (Fields! Turnover last year. Value) + 0 = 0, Nothing, 
  Fields!MargeVorigJaar. Value ) / IIF ( SUM ( Fields!OmzetVorigJaar. Value ) +0 = 0 , 1 , SUM (Fields! Margin last year. Value) / IIF (SUM (Fields! Turnover last year. Value) 0 = 0, 1,
  SUM ( Fields!OmzetVorigJaar. Value ) ) ) ) (SUM (Fields! Turnover last year. Value))))




This formula calculates the percentage margin of the preceding year (last year's margin / sales last year).

First make sure the number you want to share which is 0 (number + 0 = 0). If so fill in the textbox with Nothing and stops the further calculation. Nothing is the same as NULL in SQL, just with a different nickname. You can also use an empty string in the textbox stop ". My experience is that you can get this problem when the outcome of this cell in another cell to use (Report Items). The input is an empty string and there you can not create formulas.

If the number is not 0 then the division is performed.
Copyright 2008. All Rights Reserved.

Trackback (0)

TrackBack URI for this post

Comment (0)

RSS feed Comments

Write comment

bold italicize underline strike url image quote smile wink laugh grin angry sad shocked cool tongue kiss cry
| groter smaller | bigger
security image
Write the displayed characters

busy