Skip to content
Home » SQL Server CEILING Function

SQL Server CEILING Function

SQL Server CEILING Function is a mathematical function that returns the smallest integer value that is greater than or equal to a number.





SYNTAX

CEILING ( numeric_expression )

numeric_expression
Is a numeric input value or approximate numeric data type category.

Lets look at an example of CEILING() function in SQL Server.

CEILING function with positive values

For input value 100.00

SELECT CEILING(100.00) AS OUTPUT

It returns a smallest integer value 100 that is grater than or equal to input value 100.

 

For input value 100.01

SELECT CEILING(100.01) AS OUTPUT

It returns a value 101, which is a smallest integer value that is greater than input value 100.01.

 

For input value 560.56

SELECT CEILING(560.56) AS OUTPUT

It returns a value 561, which is a smallest integer value that is greater than input value 560.56.

 

CEILING function with Negative values 

For negative input value -560.56

SELECT CEILING(-560.56) AS OUTPUT

It returns a value -560, which is a smallest integer value that is greater than input value -560.56.

 

For negative input value -00.16

SELECT CEILING(-00.16) AS OUTPUT

 

 

 

 

 

It returns a value -0, which is a smallest integer value that is greater than input value -00.16.

 

For negative input value -100.00

SELECT CEILING(-100.00) AS OUTPUT

It returns a value -100, which is a smallest integer value that is greater than input value -100.00.

Also Readd..

FLOOR()

SQL Basics TutorialSQL Advance TutorialSSRSInterview Q & A
SQL Create tableSQL Server Stored ProcedureCreate a New SSRS Project List Of SQL Server basics to Advance Level Interview Q & A
SQL ALTER TABLESQL Server MergeCreate a Shared Data Source in SSRSSQL Server Question & Answer Quiz
SQL DropSQL Server PivotCreate a SSRS Tabular Report / Detail Report
..... More.... More....More
Power BI TutorialAzure TutorialPython TutorialSQL Server Tips & Tricks
Download and Install Power BI DesktopCreate an Azure storage accountLearn Python & ML Step by stepEnable Dark theme in SQL Server Management studio
Connect Power BI to SQL ServerUpload files to Azure storage containerSQL Server Template Explorer
Create Report ToolTip Pages in Power BICreate Azure SQL Database ServerDisplaying line numbers in Query Editor Window
....More....More....More




Loading

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SQL Skull

Subscribe now to keep reading and get access to the full archive.

Continue reading