none
So can anyone help me write this IIF statement? RRS feed

  • Question

  • Ok, so here is my problem, I'm trying to Sum the value of a column if that column is numeric?  Simple enough I though. But it looks like we evaluate both sides of the IIF statements before we fire them off, and if something in that IIF statement doesn't Jive, we get  #Error

    So this is what I'm trying to do




    =IIF(Isnumeric(Fields!ReportField4.Value),Sum(fields!ReportField4.Value),"")


    but if Fields!ReportField4.Value isn't numeric in the first place..were goin to get an error


    Living my life at 123mph in 11.15 seconds
    Monday, August 4, 2008 6:21 PM

Answers

  •  Ok, well I'm not sure if this is the best answer, but it works.

    I tried doing this without the  Cdbl function "Conver to double", but it still had an error

    Once I added the conversion, it works fine. GO figure eh? heh


    Sum(Cdbl(IIF(Isnumeric(Fields!ReportField3.Value),Fields!ReportField3.Value,0)))


    Living my life at 123mph in 11.15 seconds
    • Marked as answer by Blasty Monday, August 4, 2008 7:44 PM
    • Unmarked as answer by Blasty Monday, August 4, 2008 7:44 PM
    • Marked as answer by Blasty Monday, August 4, 2008 7:44 PM
    Monday, August 4, 2008 7:44 PM