|
Home > Archive > MS SQL Data Warehousing > November 2006 > Convert integer to date
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Convert integer to date
|
|
| Michel 2006-11-09, 7:14 pm |
| 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)(SUB
STRING(((DT_WSTR,8)D
ATE),7,2) + "/" +
SUBSTRING(((DT_WSTR,
8)DATE),5,2) + "/" +
SUBSTRING(((DT_WSTR,
8)DATE),1,4))
YYYY/MM/DD: (DT_DBTIMESTAMP)(SUB
STRING(((DT_WSTR,8)D
ATE),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 =E9crit :
> 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.
>=20
> Can anyone help me out??
>=20
> Kind regards,
>=20
> Michel Mols
|
|
|
|
|