[Add Date from variable [2]] Error: An error occurred while attempting to perform a type cast. Getting error..

  • Hello ,

    I am getting below error when I am adding row into destination table using derived column.

    [Add PaymentDate_FirstOfMonth from variable [2]] Error: An error occurred while attempting to perform a type cast.

    [Add PaymentDate_FirstOfMonth from variable [2]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "Add PaymentDate_FirstOfMonth from variable" failed because error code 0xC0049064 occurred, and the error row disposition on "Add PaymentDate_FirstOfMonth from variable.Outputs[Derived Column Output].Columns[Derived Column 4]" 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.

    [Charges Transaction Source [35]] Error: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.

    ---> And below is my derived column expression which comes from variable( variable data type is string) and destination column datatype is date.

    (DT_DBDATE)(SUBSTRING(@[User::PaymentDate],1,4) + " - " + SUBSTRING(@[User::PaymentDate],5,2) + " - " + SUBSTRING(@[User::PaymentDate],7,2))

    Can you please help me any one where I am wrong on this expression.

    I appreciate your help.

    Thanks,

  • Hi, I assume you are putting the date in yyyy-mm-dd format, am I right? Can you give me an example of the variable content, just to be sure that you are extracting the date parts in the right way with the substring.

    Let me know!

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

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