0
votes

i am currently using data conversion with data flow to convert a field returned from an SQL Database to datatype date[DT_DATE], this results in the date displaying in the following format: “2013-04-08 00:00:00".

How can I convert it to appear instead as dd/mm/yyyy eg: “08/04/2013”? SSIS does not seem to have a preset datatype for this.

1

1 Answers

0
votes

Use a derived column transformation. This provides yyyy-mm-dd hr:mn:ss so you should be able to convert it to your requirements

 (DT_WSTR,4)YEAR(GETDATE()) + "-" 
+ RIGHT("0" + (DT_WSTR,2)MONTH(GETDATE()), 2) + "-" 
+ RIGHT("0" + (DT_WSTR,2)DAY( GETDATE()), 2) + " "
+ RIGHT("0" + (DT_WSTR,2)DATEPART("hh", GETDATE()), 2) + ":"
+ RIGHT("0" + (DT_WSTR,2)DATEPART("mi", GETDATE()), 2) + ":"
+ RIGHT("0" + (DT_WSTR,2)DATEPART("ss", GETDATE()), 2)