tsurahman
tsurahman

Reputation: 11

SQL Server SUM() 2 decimal

In SQL Server 2005

I have record like this

column_name
1.23424
4.32524
5.24123
7.84927
10.76192
2.77263

how to to SUM() just only 2 decimal?

column_name
1.23
4.33
5.24
7.85
10.76
2.77

thanks

Upvotes: 1

Views: 878

Answers (1)

Joel Coehoorn
Joel Coehoorn

Reputation: 415931

You mean ROUND()?

But even that is tricky. Read the docs, and you'll see it still returns a plain numeric expression, which likely still includes trailing zeros. You may need to do extra string processing to get the exact display value you want, and that's likely better done on the client.

Upvotes: 2

Related Questions