question

jhowe avatar image
jhowe asked

ssis convert dd/mm/yyyy yyyymmdd

Hi title is pretty self explanatory! What's the best way of doing this in SSIS? I looked at data conversion but seems like it will only handle dd-mm-yyyy not with forward slashes?
sql-server-2005ssis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jhowe avatar image
jhowe answered
Yes that is pretty similar to what i came up with, whack this in a derived column transform TRIM(DateOfBirth) == "" ? NULL(DT_WSTR,1) : TRIM(SUBSTRING(DateOfBirth,7,4) + SUBSTRING(DateOfBirth,4,2) + SUBSTRING(DateOfBirth,1,2))
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

robbin avatar image
robbin answered
You can use SUBSTRING for that SUBSTRING(datetimecol, 7,4)+ SUBSTRING(datetimecol, 3,2) + SUBSTRING(datetimecol, 1,2)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.