Joshua Son
Joshua Son

Reputation: 1897

Why excel and sql server calculation is different?

Let's have a look at the picture.

enter image description here

The result is different even though the expression is the same.

Why does this happen?

I have to follow excel result, what should I have do with sql server?

Upvotes: 2

Views: 3386

Answers (1)

M.Ali
M.Ali

Reputation: 69524

No matter whatever the software is 1+1 will always yeild 2 and if its not you should check you calculation again. see below

SELECT ((4972000.0000) * (1.0000 - 4.4000/100.0000)) 
         / ((1.0000 + ((36.0000/365.0000)) * (13.0000 / 100.0000)))


RESULT: 4693057.996104

To get the result on upto four decimal places Use ROUND() function.

SELECT ROUND(((4972000.0000) * (1.0000 - 4.4000/100.0000)) 
       / ((1.0000 + ((36.0000/365.0000)) * (13.0000 / 100.0000))), 4)

RESULT: 4693057.996100

Upvotes: 1

Related Questions