Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Formatting value output with TSQL

How does one format the value output of a TSQL statement?
I have:
Sum(da.Nvalue1*da.nRoE) AS TotalValue
and get a number with 9 decimal places. I just want 2!
Thanks,
Laurel
P.S. HI EVERYBODY!!!! :WAVE:
[239 byte] By [Laurel] at [2007-11-11 10:31:38]
# 1 Re: Formatting value output with TSQL
http://www.google.com/search?q=t-sql+decimal+places ;-)
Phil Weber at 2007-11-11 23:43:15 >
# 2 Re: Formatting value output with TSQL
Thanks, Phil Darlin'!

As usual, I figured it out after I posted the question. Here's what I came up with (I really wanted to round it with no decimals in the end.)

Cast(Round(Sum(da.Nvalue1*da.nRoE),0)as int) as TotalValue

Love and kisses,
Laurel
Laurel at 2007-11-11 23:44:15 >