Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
KilpAr
Yak Posting Veteran
80 Posts |
Posted - 2012-04-23 : 09:38:47
|
I get results from SUM-function with four decimals. I want them with two decimals. In Excel the solution is for example =TEXT(D1,"0.00"). What's the way to make similar results in T-SQL? |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-04-23 : 09:42:20
|
[code]CAST(SUM(YourCol) AS DECIMAL(19,2))[/code] |
 |
|
KilpAr
Yak Posting Veteran
80 Posts |
Posted - 2012-04-23 : 09:45:48
|
Thanks, I was clearly just missing the first CAST( from there! |
 |
|
|
|
|