Over the next few days we are going to start the migration to a new forum application. I'm going to start with high post count and active users. You may receive an invitation to the new forums. It's not spam. It's just me trying to seed the user base. My goal is to open it up over the weekend.

Once we open the site we'll block registrations here. We should be open shortly on the new site.

SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 number to precision 2
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

seeker62
Starting Member

40 Posts

Posted - 04/26/2013 :  16:06:26  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 04/26/2013 :  16:40:17  Show Profile  Reply with Quote
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 - 04/26/2013 :  16:46:59  Show Profile  Reply with Quote
Thanks worked like a dream.
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 04/26/2013 :  17:29:16  Show Profile  Reply with Quote
you are welcome - glad to help.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000