SSRS Expression IIF Zero then ... Got #Error

  • Hello,

    Need some help for SSRS.

    The column % expression is

    =iif(sum(Fields!ColumnA.Value) = 0 or sum(Fields!ColumnB.Value) = 0,0,sum(Fields!ColumnB.Value) / sum(Fields!ColumnA.Value))

    But I am getting #Error if ColumnA is zerro and no error if ColumnA and B had no value. Please advise.

    Thank you.

     

     

  • Thanks, It helps.

  • Please consider learning standard SQL. We don't have an IFF() construct; that was spreadsheets and perhaps some nonrelational languages. Take the time to write everything out as a CASE expression. This will give you an ELSE clause that will force you to think in three-value logic.

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • jcelko212 32090 wrote:

    Please consider learning standard SQL. We don't have an IFF() construct; that was spreadsheets and perhaps some nonrelational languages. Take the time to write everything out as a CASE expression. This will give you an ELSE clause that will force you to think in three-value logic.

    It is about SSRS not SQL, so more like a spreadsheet.

  • jcelko212 32090 wrote:

    Please consider learning standard SQL. We don't have an IFF() construct; that was spreadsheets and perhaps some nonrelational languages. Take the time to write everything out as a CASE expression. This will give you an ELSE clause that will force you to think in three-value logic.

    Hey Joe buddy.... RTFM.  Or rather... read the breadcrumb.  Did you see the screenshot?

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply