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
 round function

Author  Topic 

sanjay5219
Posting Yak Master

240 Posts

Posted - 2010-08-29 : 14:23:15
Dear All,

I have created one query where i am using round function.Now where ever i am getting 90.23655 system is showing 90.23 which is correct but where value is 90.000 system is showing 90 not 90.00.

I want whatever is the value system should show 2 decimal

Please help

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-08-29 : 14:38:44
I think you are using FLOAT datatype. Read Books Online for different behaviour of FLOAT datatype.
What you can do, is to CAST or CONVERT the column do DECIMAL.

SELECT ..., CAST(ColX AS DECIMAL(18, 2))
FROM Table1
WHERE ...



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -