Home Forums Reporting Services SSRS 2016 Getting a #Error with Expression When Dividing 0 by 0 RE: Getting a #Error with Expression When Dividing 0 by 0

  • Hello,

    I have a thought on this.  Is it an error when Presentations has a value of 0 or when it is null?  You may want to also check for null values as dividing by null I think will give you an #Error as well.
    The other thing I can think of is what does the error window say?  It usually tells you what was wrong if something is wrong.

    For debugging purposes, you could change your IIF to:
    =IIF(Fields!Presentations.Value=0,0,1)

    that way you can determine what is wrong.  It will tell you which rows are seeing the value as 0 and what rows are seeing it as non-zero.
    Also, what is the datatype on Presentations?  If it is not an int or a derivitive of int, comparing it to the integer 0 will return false I believe.  That is, I am fairly confident that SSRS sees 0 and "0" (integer vs string) as different values.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.