Home > front end >  Round decimals to upper value using T-SQL
Round decimals to upper value using T-SQL

Time:11-12

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

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

CodePudding user response:

try this

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