locked
using iif in ssrs RRS feed

  • Question

  • Hi,

    we have 2 columns as mentioned below,

    1)CallOpenDate

    2)CallClosedDate

    3)TotaldaysTakentoClose

    we have the difference coulmn named as "Totaltime" = 24

    we are getting the value of "Totaltime" i.e,24 in query but in report it is not getting displayed giving error as"#error",when we use the following formula,

    =iif(fields!CallOpenDate.Value=fields!CallClosedDate.Value,fields!Totaltime.Value &" Hours",fields!TotaldaysTakentoClose)

    our requirement is if CallOpenDate = CallClosedDate Then display the Totaltime(Hrs) Otherwise display TotaldaysTakentoClose.

    Pls guide us to resolve that error

    Friday, August 10, 2012 11:38 AM

Answers

  • Hi Karuna,

    Based on the current information, please make sure the "CallOpenDate" field and the "CallClosedDate" field have the same data type. You can try the expression below:

    =IIF(CStr(Fields!CallOpenDate.Value)=CStr(Fields!CallClosedDate.Value),Fields!Totaltime.Value &" Hours",Fields!TotaldaysTakentoClose.Value)

    If the issue persists, please elaborate the issue for further analysis.

    Regards,
    Mike Yin


    Mike Yin

    TechNet Community Support

    • Marked as answer by Mike Yin Monday, August 20, 2012 4:32 PM
    Friday, August 17, 2012 9:48 AM

All replies

  • Hi,

    Try this, may be a data type issue

    =iif(fields!CallOpenDate.Value=fields!CallClosedDate.Value,CSTR(fields!Totaltime.Value) &" Hours",CSTR(fields!TotaldaysTakentoClose))
    


    - Chintak (My Blog)

    Friday, August 10, 2012 12:07 PM
  • Hi Karuna,

    Based on the current information, please make sure the "CallOpenDate" field and the "CallClosedDate" field have the same data type. You can try the expression below:

    =IIF(CStr(Fields!CallOpenDate.Value)=CStr(Fields!CallClosedDate.Value),Fields!Totaltime.Value &" Hours",Fields!TotaldaysTakentoClose.Value)

    If the issue persists, please elaborate the issue for further analysis.

    Regards,
    Mike Yin


    Mike Yin

    TechNet Community Support

    • Marked as answer by Mike Yin Monday, August 20, 2012 4:32 PM
    Friday, August 17, 2012 9:48 AM