rajiv-170183
Ten Centuries
Points: 1227
More actions
November 25, 2004 at 9:08 am
#59810
hey all
there seems to be two different results for the following queries.
a) select round(101.2345,2)
b) declare @var int
set @var = 101.2345
select round(@var,2)
can u explain why there happens to be two different results
thanx
Rajiv.
Allen Cui-55137
SSC Guru
Points: 51650
November 25, 2004 at 9:29 am
#531543
You can't declare int type since it is Integer (whole number), Use declare @var decimal (7,4).
November 25, 2004 at 9:55 am
#531546
hey allen
i think even if i declare it as decimal .....i get different results....why?
i did::::
declare @var decimal
Ninja's_RGR'us
Points: 294069
November 25, 2004 at 1:13 pm
#531558
you must specify the precision :
declare @var decimal (7,4)
November 26, 2004 at 9:30 am
#531626
thanx for ur help...now i got it
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply