August 17, 2011 at 11:17 pm
Hi there,
I would like to round the following number: 12,999 to 13,000 and I cant find a way, all the round options are decimal rounds.
anyone has an idea?
Thanks!
A clever person solves a problem. A wise person avoids it. ~ Einstein
select cast (0x5365616E204465596F756E67 as varchar(128))
August 17, 2011 at 11:31 pm
August 18, 2011 at 12:45 am
August 19, 2011 at 6:55 pm
It looks to me like ur trying to round() on an integer.
Round() will ONLY be effective on decimal and money data types. In fact it does not work the way you expect it to on float values. Floats are approximate values where as decimal and money have precision.
My advice is to cast your values as money or decimal, then wrap that in round().
Try looking up round in the online msdn documentation for a full explanation.
Good luck.
August 19, 2011 at 8:29 pm
I appreciate all you responses. Thanks
A clever person solves a problem. A wise person avoids it. ~ Einstein
select cast (0x5365616E204465596F756E67 as varchar(128))
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply