Math Functions – FLOOR()

I am going to carry one with my series of short articles or tidbits on Transaction SQL math functions. Most, if not all, of these functions have been in the product before the release of SQL Server 2005.

I am very proud of my daughter making the advance math class in sixth grade. I am dedicating these blogs to her hard class work and love of the subject.

I will be exploring the FLOOR() function today. This function takes as input a expression in either exact numeric or approximate numeric form. This does not include the BIT data type. It returns the smallest integer less than, or equal to, the specified numeric expression as output.

The example below tests the FLOOR() function with three different inputs: negative numbers, positive numbers and a null value.

The output from the test is listed below.

In summary, this function will return the next integer less than or equal to the numeric expression.

Related posts

Leave a Comment