I am trying to cast a String (DT_WSTR) as a Date Format (DT_DBDATE) in SSIS.
My source is a Excel-File and the input field looks as follows: OCT 04 2020
My Result should have the format 2020-10-04
I use a Derived Column Editor and created this expression:
(DT_DBDATE)(SUBSTRING([BILLING CYCLE DATE],8,4) + "-" + SUBSTRING([BILLING CYCLE DATE],1,3) + "-" + SUBSTRING([BILLING CYCLE DATE],5,2))
The error I get is:
[Derived Column [312]] Error: An error occurred while attempting to perform a type cast.
[Derived Column [312]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "component "Derived Column" (312)" failed because error code 0xC0049064 occurred, and the error row disposition on "input column "BILLING CYCLE DATE" (388)" 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.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Derived Column" (312) failed with error code 0xC0209029 while processing input "Derived Column Input" (313). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.
I know that there are several questions that a similar, I also tried a lot of them but nothing helped me so far.
I have no Idea why it is not working as it used to work one month ago. And in other SSIS Packages similar expressions are working fine.
Any answer is appreciated!