#Error handling in expressions RRS feed

  • Question

  • Hi Community!

    I am having some issues handling #Error messages. At first I get the Value "StartDate" from a db source, this works well (Code.RDA.GetBusinessValueString(Fields!Folder.Value,"StartDate")). My next step is to check if there is any value available for that row. So I compare the result with "no value", which works fine as well. If there is "no value" i want simply to print "-". So far so good. If there is a value I am printing that value of course. The code below works as the description above:

    =IIF(Code.RDA.GetBusinessValueString(Fields!Folder.Value,"StartDate") = "no value","-",Code.RDA.GetBusinessValueString(Fields!Folder.Value,"StartDate"))

    When the value is printed it is in this DateTime-Format: "2016-01-05T02:00:00". Now i want to switch the format in the same step, so i tried the following (and many others):

    =IIF(Code.RDA.GetBusinessValueString(Fields!Folder.Value,"StartDate") = "no value","-",CDate(Code.RDA.GetBusinessValueString(Fields!Folder.Value,"StartDate")))

    =IIF(Code.RDA.GetBusinessValueString(Fields!Folder.Value,"StartDate") = "no value","-",FormatDateTime(Code.RDA.GetBusinessValueString(Fields!Folder.Value,"StartDate"),DateFormat.ShortDate))

    Result: 05. Jan. 2015 or 05.01.2015 which is both ok for me. Bit the "no value" handle is broken yet. Now i get everywhere instead instead of "-" only "#Error". I tried a lot of things (DateTimeFormat, IsNothing,...) and i really dont know why this is happening, anyone an idea?

    Thanks and a happy new year


    Tuesday, January 5, 2016 3:53 PM