Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
zoom19
zoom19
SSC Rookie
SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)

Group: General Forum Members
Points: 26 Visits: 302
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:TongueaymentDate],1,4) + " - " + SUBSTRING(@[User:TongueaymentDate],5,2) + " - " + SUBSTRING(@[User:TongueaymentDate],7,2))


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

I appreciate your help.

Thanks,
andrea.gnemmi
andrea.gnemmi
SSC Veteran
SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)

Group: General Forum Members
Points: 235 Visits: 162
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!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search