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 2008 Forums
 Transact-SQL (2008)
 Lat/LOng round off

Author  Topic 

akpaga
Constraint Violating Yak Guru

331 Posts

Posted - 2012-04-09 : 18:16:44
Hi friends

I have mt long/Lat in the following way in my database:
-10142771.52195010 / 3561944.31631357 datatype is numeric(38,8)

HO can i round them off to xxx.xxx/yyy.yyy i.e decimal(3,3)...

Please let me know...Thank you in advance

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2012-04-09 : 20:32:14
you mean decimal(38,3) right?

declare @longlat numeric(38,8)
SET @longlat = -10142771.52195010
SELECT ROUND(@longlat, 1)
SELECT CAST(ROUND(@longlat, 1) as decimal(38,3))


<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -