Round and round we go....

  • 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))

  • DECLARE @Var MONEY

    SET @Var = 12999

    SELECT @Var, ROUND(@var, -3)

    _____________
    Code for TallyGenerator

  • look up Ceiling and FLOORand get creative.

    Jayanth Kurup[/url]

  • 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.

  • 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