T-SQL:
How to round to the nearest WHOLE number ?
so
from --> to
170 --> 170
96.58 --> 97
thanks
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))
Showing posts with label t-sqlhow. Show all posts
Showing posts with label t-sqlhow. Show all posts
Saturday, February 25, 2012
round to nearest WHOLE number
T-SQL:
How to round to the nearest WHOLE number ?
How to round to the nearest WHOLE number ?
so
from -- to
----
170 --170
96.58 --97
thanksHere 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))
round to nearest WHOLE number
T-SQL:
How to round to the nearest WHOLE number ?
so
from --> to
--
170 --> 170
96.58 --> 97
thanksHere 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))
How to round to the nearest WHOLE number ?
so
from --> to
--
170 --> 170
96.58 --> 97
thanksHere 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))
Subscribe to:
Posts (Atom)