What is difference between the Ceiling
and Round
functions in in SQL Server?
I have some query and I get a totally different value in Round
and Ceiling
function.
Advertisement
Answer
The answer is here
Round does a standard rounding. If value is .5 or over then you get back 1. If it’s less than .5 you get back 0
Ceiling returns the integer equal to or higher than the value passed in.
SELECT ROUND(235.400,0); Answer= 235.000 SELECT CAST(ROUND(235.400,0) as int) Answer= 235