Jesus
Jesus

Reputation: 475

Round decimals to upper value using T-SQL

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

Upvotes: 1

Views: 59

Answers (1)

guu876
guu876

Reputation: 67

try this

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

Upvotes: 1

Related Questions