Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

[Add Date from variable [2]] Error: An error occurred while attempting to perform a type cast. Getting error.. Expand / Collapse
Author
Message
Posted Monday, September 30, 2013 8:48 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, February 7, 2014 1:45 PM
Points: 26, Visits: 266
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,
Post #1500046
Posted Wednesday, October 2, 2013 2:26 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 6:59 AM
Points: 232, Visits: 159
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!
Post #1500695
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse