I'm using the SSIS Derived Column transformation. The source of the field is the Filename that's saved in the flat file source. Thefully-qualified UNC path is
\\v201.os33cust.net\TKFMC\groups\Managed Care Operations\Health Plan Specific Data\Self-Funded\MedImpact\Accumulator\Download\Reload\type28_phi01_ais_02032021_02032021_001.txt
Since the filename is a UNC path, and I just need the date portion of it in yyyy-mm-dd format, I wrote the following expression in the derived column transformation:
(DT_DBDATE)(SUBSTRING(Filename,155,4) + "-" + SUBSTRING(Filename,151,2) + "-" + SUBSTRING(Filename,153,2))
The initial processing succeeded a few days ago. Today, an error is thrown stating:
An error occurred while attempting to perform a type cast.
The destination field for the above expression is in SQL Server 2016 using the date field type. The reason the date is formatted as yyyy-mm-dd is because the format is needed further downstream when I produce a flat file requiring this format.
Since the process succeeded a few days ago, and nothing has changed with regard to environment, table etc., I'm curious to know how best to resolve this issue?