Friday, February 24, 2012

Date field in exported excel file

Date field in exported excel file.

I export a table to excel file by using DTS. It seems the date field show as ###### when I open the excel file. If I expend the column I see the date. Is there any way I export in away that this date field will not show up as #####.

Very Good Q just like if there is Nvarchar Data type with length 4000, why not it auto expend when i see it with select query in SQL? Continue....|||

Hi,

I didn't find any issue here. There is nothing wrong with your data; the cell simply isn’t big enough to display the result. Widen the column

SQL Server's task is to export data into excel & it does properly. You are not loosing any data here. When it export the data it doesn't format any data, it fills/writes all the data on Rows & Columns. It uses the default column width to fill the data(64 Pixels). You can expand your columns to read your data properly (there is no data loose)

SQL Server only export data & it never format your data (don't expect that it will bold your Header column, auto size your column width & etc.)

WHY IT IS NOT FORMATING?

Bcs SQL Server export taks uses the JET Provider to write the data. (here excel docuemnt will be treated as database rather than doc).It is not using EXCEL ActiveX EXE to fill the data.

The export code may use the following connection string to export,

Provider=Microsoft.Jet.OLEDB.4.0;Data Source={File Path};Extended Properties="Excel 8.0;"

No comments:

Post a Comment