Expression Data Type Conversion RRS feed

  • Question

  • I am getting the following error in my report. I am tring to program the BackgroungColor Expression so the if the value is null display a blue color else leave it white.

    Conversion from string "" to type 'Date' is not valid

    Here is my code sample:

    =Iif(Fields!ReturnTime.Value = "", "AliceBlue", "White")

    Friday, November 3, 2006 7:29 PM


  • Hi RayClark,

    You cannot compare a string with a date.
    You can do this in several ways here is one:

    =IIF(Len(Fields!ReturnTime.Value)=0, "AliceBlue", "White")

    Use the length function to check the length of return time.  If it is 0 set it to alice blue else set it to white :).
    Friday, November 3, 2006 7:51 PM

All replies