Saturday, 20 July 2024

FLOOR Function in sql server

The FLOOR () function returns the nearest integer that is less than or equal to the specified number or numeric expression. The FLOOR () function is mainly used to round the floating-point value without fraction part from the floating point number value (decimal, double, float).  If the number is already an integer, it returns the same number as the result. 

Syntax

Floor (numeric value)

Numeric value: A valid numeric expression. If we pass other than it will throw as error.

See the example:

SELECT FLOOR (3.34) AS PosInt,  FLOOR (-3.34) AS NegInt;

If we put other than numeric it will throw as error.

No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts