SSIS Convert a string into a date
- Joel Lipman
- SQL Server Integration Services
- Hits: 37759
Please note: the following article is not a solution but a page of various methods and date conversions which I try and use depending on the situation.
This is a quick article on how I got time conversion working in an SSIS package which read from a text file. Note that the example below converts a string in European Date Format (ie. "ddmmyyyy" to "dd/mm/yyyy"). Also, my data flow imports two dates one which was imported as a string (DT_WSTR) and another as a integer (DT_R8).
Why?
It took me a long time to figure this and it was only by trawling through columns that someone mentioned that maybe all the data in that column is not consistent? This made sense as I need to parse the string to extrapolate the date, month and year.
How?