Link to home
Start Free TrialLog in
Avatar of Goodangel Matope
Goodangel MatopeFlag for Zambia

asked on

SQL Server precision differing from excel precision

I have developed a treasury system for a company that was using Microsoft Excel for their processing. I have moved most of the processing into SQL Server procedures and functions. The interesting thing is that for large values, the calculations in SQL Server and those in excel yield different values. Is this a data type issue? I am using DECIMAL(38,2) for all currency values. I am puzzled as to why we are getting different values after using the same formulae in excel and SQL Server.
Avatar of JesterToo
JesterToo
Flag of United States of America image

The decimal format stores numbers in  SS2000 as BCD (binary coded decimal) with a maximum precision of 38 digits.  Excel is using floating-point which has less precision.  However, if you perform math operations with the numbers you may find that your application introduces loss of precision (due to intermediate rounding) with either data.
ASKER CERTIFIED SOLUTION
Avatar of solution46
solution46

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial