Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Round decimals to upper value tsql

I have a simple SUM with ROUND statements as:

SUM(ROUND([SOI].[SOIQuantity] * [SOI].[SOIPrice] , 2)) AS [TotalPrice]

The result of this is: 4747.65

The funny thing is, if I use three decimals, the result is: 4747.662

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So my question is: why is it round the decimals to .65 instead .66? My desired result is to get .66, how can I achieve that? Regards

>Solution :

try this

ROUND(SUM([SOI].[SOIQuantity] * [SOI].[SOIPrice]), 2) AS [TotalPrice]
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading