Skip to content
Advertisement

what is difference between ceiling and roundup server in sql server

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.

enter image description here

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
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement