Derived Column - isnull with a date

  • In a Derived Column transformation I want to transform a date such that if it is a null then replace it with 1753-01-01 otherwise keep the date value.  However I’m getting an error.

     

    I’m using the following expression:

    ISNULL( [hrs_client_dob] ) ? 1753-01-01 00:00:00.000  :  [hrs_client_dob]

     

    [hrs_client_dob] is being sourced from a SQL Server 2005 table and has datetime format.

     

    The data type of the expression in the Derived Column transformation is DT_DBTimeStamp

     

    I’ve tried double & single quotes around the date/time. I’ve tried it with no time values.  I’ve tried different data types in the Derived Column transformation.  All with no success.

     

    What am I doing wrong?

  • Have you tried casting the date string, (DT_DBTIMESTAMP) "1753-01-01 00:00:00.000"?

  • That it's!  It's working.

    Thanks Nathan.

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply