Hi,
I have a couple of csv files with a date column like '20061231' or
'20050521'. What is the easiest way to convert this column into a date in the
SSIS pipeline?
The connection manager doesn't accept just defining the column as a date.
Also, converting the integer into a date using the Convert transformation
does not work well.
Can anyone help me out?
Kind regards,
Michel Mols
Hi Michel,
I can propose you a way to solve that problem. I've already get the
same problem in a project and I used to create a dervied column with
that expression to get my date in that format DD/MM/YYYY:
(DT_DBTIMESTAMP)(SUBSTRING(((DT_WSTR,8)DATE),7,2) + "/" +
SUBSTRING(((DT_WSTR,8)DATE),5,2) + "/" +
SUBSTRING(((DT_WSTR,8)DATE),1,4))
YYYY/MM/DD: (DT_DBTIMESTAMP)(SUBSTRING(((DT_WSTR,8)DATE),1,4) + "/" +
SUBSTRING(((DT_WSTR,8)DATE),5,2) + "/" +
SUBSTRING(((DT_WSTR,8)DATE),7,2))
I am not sure that is the best way to do that but it is at least one.
Michel a crit :
> Hi,
> I have a couple of csv files with a date column like '20061231' or
> '20050521'. What is the easiest way to convert this column into a date inthe
> SSIS pipeline?
> The connection manager doesn't accept just defining the column as a date.
> Also, converting the integer into a date using the Convert transformation
> does not work well.
> Can anyone help me out?
> Kind regards,
> Michel Mols
No comments:
Post a Comment