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)
 round the value

Author  Topic 

raky
Aged Yak Warrior

767 Posts

Posted - 2008-04-17 : 02:46:18
Hi,

I need to display the value of a certain varible rounded to two digits after decimal.

For example :

value of a is 1346.8500

I need to get the value of a as 1346.85

Please help me

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-17 : 02:49:24
What is datatype of a?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-17 : 02:51:25
SELECT CAST(a as decimal (20,2))
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2008-04-17 : 02:54:07
quote:
Originally posted by visakh16

What is datatype of a?



Numeric(19,4).

Ok thanks, visakh i will do it as cast( a as numeric(19,2)).


Is it ok????
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-17 : 03:02:47
quote:
Originally posted by raky

quote:
Originally posted by visakh16

What is datatype of a?



Numeric(19,4).

Ok thanks, visakh i will do it as cast( a as numeric(19,2)).


Is it ok????


Thats fine
Go to Top of Page
   

- Advertisement -