Comments and answers for "Excel VBA import data from SQL server. Data imported to excel shows slight difference in values."
https://ask.sqlservercentral.com/questions/32115/excel-vba-import-data-from-sql-server-data-importe.html
The latest comments and answers for the question "Excel VBA import data from SQL server. Data imported to excel shows slight difference in values."Comment by yugmorf on yugmorf's answer
https://ask.sqlservercentral.com/comments/32162/view.html
That worked a treat. Thank you!Mon, 17 Jan 2011 05:53:42 GMTyugmorfComment by Scot Hauder on Scot Hauder's answer
https://ask.sqlservercentral.com/comments/32156/view.html
When you change it to decimal you need to specify how many decimal places. If you leave it as decimal(18,0) it will round to 0 decimal places. The number on the left is the total number of digits (those on left and right of the decimal) and the number on the right is the how many decimal places you want to keep.Mon, 17 Jan 2011 04:50:17 GMTScot HauderComment by yugmorf on yugmorf's answer
https://ask.sqlservercentral.com/comments/32145/view.html
Thanks Scot. I tried changing to decimal but now both the database values (and those imported to excel) show just the rounded integer portion of the number. ie. following my example above, an original data entry of 0.7400 is now shown as 1.
If anyone has another idea about what i might be doing wrong here, please share. Thank you!Mon, 17 Jan 2011 01:34:02 GMTyugmorfAnswer by Scot Hauder
https://ask.sqlservercentral.com/answers/32123/view.html
Change the real columns in the db to decimal. If you need numbers to be exact don't use float or real.Sun, 16 Jan 2011 11:23:30 GMTScot Hauder