round to nearest WHOLE number

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • klabu

    round to nearest WHOLE number

    T-SQL:
    How to round to the nearest WHOLE number ?

    so
    from -- to
    -------------
    170 --170
    96.58 --97

    thanks






  • markc600@hotmail.com

    #2
    Re: round to nearest WHOLE number

    Here are a couple of ways

    SELECT ROUND(170,0)
    SELECT ROUND(96.58,0)

    SELECT CAST(170 AS DECIMAL(10,0))
    SELECT CAST(96.58 AS DECIMAL(10,0))

    Comment

    Working...