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 2000 Forums
 SQL Server Development (2000)
 Rounding NUmeric values

Author  Topic 

OMB
Yak Posting Veteran

88 Posts

Posted - 2003-01-09 : 12:28:18
Hi all

I am trying to round my result set to 2 decimal palces using the following query

select id,round(percentagechange,2) as percentage
from table a

However it is only rounding some of the data not all. Here is a snippet of the data



ID percentage
A 21.82
B -8.7899999999999991
C 1.55
D -5.4100000000000001
E -2.04



Any ideas would be greatly appreciated

OMB


nr
SQLTeam MVY

12543 Posts

Posted - 2003-01-09 : 12:36:47
looks like you're using an approximate data type. Try converting to decimal.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -