x

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?
more ▼

asked May 17, 2012 at 12:49 PM in Default

jhowe gravatar image

jhowe
1.1k 54 58 61

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

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))
more ▼

answered May 17, 2012 at 02:26 PM

jhowe gravatar image

jhowe
1.1k 54 58 61

(comments are locked)
10|1200 characters needed characters left

You can use SUBSTRING for that

SUBSTRING(datetimecol, 7,4)+ SUBSTRING(datetimecol, 3,2) + SUBSTRING(datetimecol, 1,2)
more ▼

answered May 17, 2012 at 01:48 PM

robbin gravatar image

robbin
1.6k 1 3 5

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1951
x947

asked: May 17, 2012 at 12:49 PM

Seen: 1408 times

Last Updated: May 17, 2012 at 02:26 PM