Derived column help

  • somehow not getting this to work in derived columns

    Condition is: if enddate is Null (space) then keep space else format like yyyy-mm-dd.

    i/p to date column is 31-12-2000

    isnull[Enddate]? " " :SUBSTRING(Enddate,7,4) + "-" + SUBSTRING(Enddate,4,2) +"-" + SUBSTRING(Enddate,1,2)

  • SSIS have taken the below syntax in derived column but when I execute the task it passes an error.

    Error is :

    SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "component "Derived Column" (221)" failed because error code 0xC0049063 occurred, and the error row disposition on "input column "Einddatum_new" (243)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.

    Any more ideas on this???

    (Enddate_new) == " " ? NULL(DT_DATE) : ((DT_DATE)(SUBSTRING(Enddate_new,7,4) + "-" + SUBSTRING(Enddate_new,4,2) + "-" + SUBSTRING(Enddate_new,1,2)))

  • What is the datatype of your derived column?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • DT_Date

  • You can't put a space in a date field.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • How do you write expression to put NUll (empty) value in date field when i/p has NULL value else cast it in YYYY-MM-DD format.

    My i/p file is CSV file (the col has data type of DT_DATE) and destination column is timestamp too.

  • Try NULL(DT_DATE)

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • My expression looks like

    (Enddate_new) == " " ? NULL(DT_DATE) : ((DT_DATE)(SUBSTRING(Enddate_new,7,4) + "-" + SUBSTRING(Enddate_new,4,2) + "-" + SUBSTRING(Enddate_new,1,2)))

    I guess it says the same.

    Let me know if I wrote something incorrect

  • Finally I got this to work!!!

    Just changed the configure error to ignore failure (its bad n risky !!)

    But it worked and gave me the values I need.

    But something I dont understand is why should this error come???

Viewing 9 posts - 1 through 8 (of 8 total)

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