Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Export non-string to Excel how to set the data type

$
0
0

How do I ensure data written to Excel is written as a Date (Integer, or Float)?

I have data coming from Excel that is of type DbDateTime, Int, Float, etc. My Excel template that I am writing to has the corresponding columns set to the matching datatype (ie. Column 3 is type Date, Column 5 is two decimal Number). However, whenever data is written to Excel, upon opening Excel all the fields have been reset to ‘General’. This impacts not only how the data is displayed, but the search/filter options as well.

I also don’t understand why despite setting the Column data type, when I view the Mapping of the Excel Destination Editor it always shows the Destination Columns type as WSTR. It’s like it does not care how Excel is formatted, it’s just going to write everything as a string.

So far the only work around we’ve discovered is to utilize a very cumbersome COM library to ensure the data is written and formatted properly. But it seems like writing a Date to Excel as an actual Date should not require so much effort (script component, using COM library, and all the associated code).

(Note- Per customer requirement this must be an Excel document. It is a daily file generated. Manually setting the column type daily is not an option.)



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>