Reputation: 125
I have a excel file that automatically imports data from an Oracle DB into the sheet. Everything works fine, but date formatting is wrong. In the Oracle DB, the format is 01-JAN-2016. But when it exports to Excel, the format suddenly changes to 1/1/2016.
Is there a good solution to this? Setting the cell format beforehand doesn't work. Once the data is imported, Excel automatically switches format to Date. I have tried a lot but can not solve this issue so I am wondering if any of you have ideas as to what to do. Thanks.
Upvotes: 0
Views: 366
Reputation: 71247
The date isn't stored in "01-JAN-2016" format, that's just a representation of the underlying date value.
The recordset contains the data, not its representation. Format the column with a NumberFormat
like dd-mmm-yyyy
, and 2016/01/01 will look like 01-JAN-2016.
Upvotes: 1