Link to home
Create AccountLog in
Avatar of earwig75
earwig75

asked on

Problem with SSIS Package, derived column

I am trying to import a .csv file into a table.  The column on the file is a date column formatted like this: 20160127

I need to import that into a date column in my SQL table. Can someone assist with a string I could use in my derived column? Thank you.

(DT_DATE)(SUBSTRING(problemDate,5,2) + "/" + SUBSTRING(problemDate,7,2) + "/" + SUBSTRING(problemDate,1,4) + " " + SUBSTRING(problemDate,9,2) + ":" + SUBSTRING(problemDate,11,2) + ":" + SUBSTRING(problemDate,13,2))
ASKER CERTIFIED SOLUTION
Avatar of earwig75
earwig75

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of earwig75
earwig75

ASKER

I found and used this solution: (DT_DATE)(SUBSTRING([MyDateColumn],1,4) + "-" + SUBSTRING([MyDateColumn],5,2) + "-" + SUBSTRING([MyDateColumn],7,2))