locked
Trying to sum a field with NULL Values for SSRS 2008 (NOT r2) RRS feed

  • Question

  • I know the easy way to kick out null values is using IsNothing, like so:

    sum(iif(IsNothing(Fields!Distinct_Student_SSP3.Value), 0, Fields!Distinct_Student_SSP3.Value))

    However, my company's production server is running SSRS 2008, and apparently this does not work, as I get #Error in any field where a null value occurs.  I'm rocking SSRS 2008 r2 on my dev machine and it works fine, values pop in with no issues; however, deploying it to the 2008 Prod box produces the errors.  Does anybody know of any "old school" ways to get around the nulls?  Is it possible to convert the nulls to 0 in the query?

    Thursday, January 17, 2013 8:59 PM

Answers

  • Try this below.

    =IIF (IsNothing(Sum(Fields!Distinct_Student_SSP3.Value)), 0, Sum(Fields!Distinct_Student_SSP3.Value))

    • Proposed as answer by Sachi_SG Thursday, January 17, 2013 9:25 PM
    • Marked as answer by puffster Thursday, January 17, 2013 9:33 PM
    Thursday, January 17, 2013 9:25 PM

All replies

  • Try this below.

    =IIF (IsNothing(Sum(Fields!Distinct_Student_SSP3.Value)), 0, Sum(Fields!Distinct_Student_SSP3.Value))

    • Proposed as answer by Sachi_SG Thursday, January 17, 2013 9:25 PM
    • Marked as answer by puffster Thursday, January 17, 2013 9:33 PM
    Thursday, January 17, 2013 9:25 PM
  • You, Sir, are a freakin' genius.  Thank you for helping me to feel like I've accomplished something today!
    Thursday, January 17, 2013 9:34 PM