SQL Server: FLOOR Function

FLOOR function in SQL Server

This SQL Server tutorial explains how to use the FLOOR function in SQL Server (Transact-SQL) with syntax and examples.

Description

In SQL Server (Transact-SQL), the FLOOR functions returns the largest integer value that is equal to or less than a number.

Syntax

The syntax for the FLOOR function in SQL Servers (Transact-SQL) is:

FLOOR( number )

Parameters or Arguments

numberThe value used to determine the largest integer value that is equal to or less than a number.

Note

Applies To

The FLOOR functions can be used in the following versions of SQL Server (Transact-SQL):

  • SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005

Example

Let’s look at some SQL Server FLOOR functions examples and explore how to use the FLOOR function in SQL Server (Transact-SQL).

For example:

SELECT FLOOR(5.9);
Result: 5

SELECT FLOOR(34.29);
Result: 34

SELECT FLOOR(-5.9);
Result: -6

This Post Has One Comment

Leave a Reply