Round

  • 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? :hehe:

    thanks!

  • Hello,

    The following script will Round 12999 to 13000:-

    Select Round(12999, -1)

    This works for the example that you provided, but what is the underlying rounding algorithm that you need?

    Regards,

    John Marsh

    www.sql.lu
    SQL Server Luxembourg User Group

  • John is correct. To become better familiar with the ROUND function, take a look a Books Online... it has a full description and many examples to help you determine what you actually need.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply