FLOOR function in SQL Server
The FLOOR function in SQL Server returns the largest integer value but less than or equal to the transmitted numeric expression.
This article will show you in detail how to use the FLOOR () numerical processing function in SQL Server with specific syntax and examples to better visualize and capture functions.
Describe
The FLOOR function in SQL Server returns the lower bound value of the number or expression, ie returns the largest integer value but less than or equal to the transmitted numeric expression.
Syntax
To use the FLOOR function in SQL Server, we use the following syntax:
FLOOR(number)
Parameters :
- number: the number passed to find the largest integer value.
Note :
- See more CEILING and ROUND functions.
- The FLOOR function can be used in later versions of SQL Server: SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, and SQL Server 2005.
For example
Take a look and explore some examples of FLOOR functions in SQL Server.
SELECT FLOOR(5.9);
Result: 5
SELECT FLOOR(5);
Result: 5
SELECT FLOOR(34.29);
Result: 34
SELECT FLOOR(-5.9);
Result: -6
SELECT FLOOR(-5);
Result: -5
Previous article: COUNT function in SQL Server
Next lesson: MAX function in SQL Server
4 ★ | 1 Vote
You should read it
- How to use the FLOOR function in Google Sheets
- ABS function in SQL Server
- DAY function in SQL Server
- MIN function in SQL Server
- MAX function in SQL Server
- SUM function in SQL Server
- AVG function in SQL Server
- MONTH function in SQL Server
- GETUTCDATE function in SQL Server
- DATEPART function in SQL Server
- ROUND function in SQL Server
- COUNT function in SQL Server