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
 Rounding

Author  Topic 

Vack
Aged Yak Warrior

530 Posts

Posted - 2012-03-27 : 13:13:42
If I have a 3 decimal number.

1.342

Is there a way I can always round up to two digits?

I would want 1.35 returned.

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-27 : 13:38:52
DECLARE @x decimal(15,4); SET @x = 1.342

SELECT ROUND(@x+.005,2)

???

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -