Home > Archive > MS SQL Server > November 2006 > round to nearest WHOLE number









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author round to nearest WHOLE number
klabu

2006-11-16, 7:12 pm

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

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

thanks






markc600@hotmail.com

2006-11-16, 7:12 pm

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

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com