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
- See also the CEILING and ROUND functions.
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
Pingback: SQL Server: CEILING Function - Adglob Infosystem Pvt Ltd