I have an SSIS package, which I am running a Stored Procedure and save the resultset in a object type of variable (as temptable) in the control flow, and in the data flow I am using a script to retrieve data from the object type of variable saving the result set in an excel file.
Everything works well except the date column. It should be in dd/mm/yyyy format, however whatever I have tried I could not prevent it to be in m/d/yyyy format in the excel.
What I have tried are:
1- Added this to connectionstring of Excel ConnectionManager -> Excel 12.0;HDR=Yes;IMEX=0;Readonly=False
and Excel 12.0;HDR=Yes;IMEX=1;Readonly=False
. Both did not work.
2- Added a Derived Column task, derived a new "DerivedMyDate" column as STR
, WSTR
, Date
. Used this column to save the date value in the excel file, where type is set as STR
and DATE
. None of my trials worked.
3- Added Data Conversion task, tried all same things that I've tried in 2nd step, none worked.
4- Added a dummy first line in the excel, where the data column is like 15/01/1900
. Does not work, it is adding the other rows below where date values in m/d/yyyy
format.
Checked those pages, the answers did not work for me: Date format problem using SSIS for Excel into SQL Server
TimeZone of my PC: (UTC-05:00) Eastern Time (US & Canada), changing this is not an option.
Any help or advice would be appreciated.