June 4, 2010 at 7:45 am
I need a query with sample results below :
for example i have float columns
10.125
50.2550
40.5
--------
sum=100.88
but i want this sum like this , 2 digits after comma :
10.12
50.25
40.5
--------
sum=100.87
How can i do with tsql command. Thanks ...
June 4, 2010 at 8:31 am
DECLARE @test TABLE (Col1 float)
INSERT INTO @test
SELECT 10.125 UNION ALL
SELECT 50.2550 UNION ALL
SELECT 40.5
SELECT sum(round(col1,2,1))
FROM @test
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 4, 2010 at 8:37 am
Thank you very much Wayne. That's really good.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply