This is a discussion on Reading numbers from Excel within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Hi, Today we discovered a problem when importing numbers from Excel (XP) into MS SQL Server 2000. e.g. when ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, Today we discovered a problem when importing numbers from Excel (XP) into MS SQL Server 2000. e.g. when the number 11301.80 is stored in the Excel spreadsheet then MS SQL Server reads this as 11301.800000000001. This value is stored in a float column and this row cannot be retrieved using the clause "where Amount = 11301.80". I'm aware that both floats and reals do not store exact values but when you insert this value 11301.80 using the Query Analyzer then everything is working fine. I thought that both Excel and SQL server were using the same precision (8 bytes/15 digits). This is an application that we didn't write ourselves and I guess I have found the solution by changing the column type to real. Any ideas why this goes wrong? Thanks, Alain Sienaert P.S. Please note that this problems also occures when creating a linked server to the Excel spreadsheet. When retrieving the data the Query Analyzer displays 11301.800000000001. |