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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to round the value in SQL Query

Author  Topic 

itnagaraj
Yak Posting Veteran

70 Posts

Posted - 2010-08-30 : 09:52:06
Hi This is the Value.How to round the value in SQl query?

66.6666666666667

Result

66.67

V.NAGARAJAN

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-08-30 : 09:54:23
SELECT ROUND(Col1, 2)
FROM Table1



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

itnagaraj
Yak Posting Veteran

70 Posts

Posted - 2010-08-30 : 10:00:08
i know the solution.but how to remove last two zero's

quote:
Originally posted by Peso

SELECT ROUND(Col1, 2)
FROM Table1



N 56°04'39.26"
E 12°55'05.63"




V.NAGARAJAN
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-08-30 : 10:03:15
SELECT CAST(Col1 AS DECIMAL(18, 2))
FROM Table1



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-30 : 10:05:36
CONVERT(Decimal(15,2), your value)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -