Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
vali1005
Starting Member
6 Posts |
Posted - 2009-03-04 : 19:23:51
|
Hello!I have, in a table, a field that holds the price of a stock. The field is defined as being of type "Real" and is populated with data imported from a text file.The issue that I am having is that, upon exporting the table to Excel or a text file, the values in this column get additional decimals.To give an example:From the text file, stock "MSFT" is imported with a price of "19.210".In the table, upon opening it with "Open Table" in MSSQL Server Management Studio, the value of the price shown for MSFT is "19.21". I get the exact same value, "19.21", if I do a "SELECT * on tblStockPrices" statement.Exporting the table to Excel, I see the MSFT price cell showing "19.21", but the content of the cell is "19.2099990844726".When exporting the table to a text file, I see the MSFT price as "19.209999"By default, in Column Mappings, the type for the Price column is shown as "Single". This is where I noticed that I couldn't change the "Scale" of the exported value. I tried switching the type of the source Price column, in Column Mappings Wizard, from "Single" to "Decimal", and then setting "Precision" to 25 and "Scale" to "3" for the exported column, but I still get the same behaviour in Excel, the cell is showing "19.21" and its content is "19.2099990844726".So, my question is, how can I make the export to Excel/text work as expected, i.e. the exported value for MSFT being "19.21" in the cell.Thank you! |
|
|
|
|
|
|