SSIS Date Conversion – Convert mmddyyyy Format to Date Using SSIS Expression

datesql serverssis

I'm receiving dates in a mmddyyyy format but want to convert it to the date format in sql/ssis yyyy-mm-dd, how can I do so using an SSIS expresion.

example of dates I'm reciving are 03051978 but want it to appear in 1978-03-05.

Thank you

Best Answer

You have to use substring to get the parts needed for year monh and so on

(DT_DATE)(SUBSTRING(yourcolumn,5,4) + "-" + SUBSTRING(yourcolumn,1,2) + "-" + SUBSTRING(yourcolumn,3,2))