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
 General SQL Server Forums
 New to SQL Server Programming
 number to precision 2

Author  Topic 

seeker62
Starting Member

40 Posts

Posted - 2013-04-26 : 16:06:26
I have this ROUND(ISNULL(lbs,0)/2000,4,2) as tons in a select statement wanting the data to show as 00.00 but it still shows as 00.00000000. the actual data that shows is 20.090000000 and i just want 20.09. If ROUND will not do this what will. I have SQL 2008 R2 and it does not recognize FORMAT. Thanks.

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-04-26 : 16:40:17
Instead of ROUND, use CAST to DECIMAL
CAST(ISNULL(lbs,0)/2000,DECIMAL(19,2))
That said, formatting is best done at the presentation layer such as Reporting Services or GUI.
Go to Top of Page

seeker62
Starting Member

40 Posts

Posted - 2013-04-26 : 16:46:59
Thanks worked like a dream.
Go to Top of Page

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-04-26 : 17:29:16
you are welcome - glad to help.
Go to Top of Page
   

- Advertisement -