Convert date DD.MM.YYYY hh:mm:ss to YYYY-MM-DD in SSIS

Viewed 1570

I am developing an SSIS package and it reads the data from SAP. I have created ADO.Net source which reads the data from ODBC connection.

From the SAP data, there is a table which has the date column and the format of the date value is 12.03.2014 00:00:00

Now I want to convert it into datetime format YYYY-MM-DD.

Can I do this in SQL command of ADO.Net source tool?

3 Answers

Take a drived column component and convert the date as expected like following example:

(DT_STR,4,1252)DATEPART("yyyy",GETDATE()) + RIGHT("0" + "-" + (DT_STR,2,1252)DATEPART("mm",GETDATE()),2) + "-" + RIGHT("0" + (DT_STR,2,1252)DATEPART("dd",GETDATE()),2) 

enter image description here

Related