CEILING (SQL Server Compact)

Returns the smallest integer that is greater than, or equal to, the given numeric expression.

Syntax

CEILING ( numeric_expression ) 

Arguments

  • numeric_expression
    An expression of the exact numeric or approximate numeric data type categories, or types that is implicitly convertible to float (except for the bit data type).

Return Value

Returns the same type as numeric_expression except for the following expressions.

Specified expression

Return type

tinyint, smallint

int

real/float

float

Nonnumeric types that can be implicitly converted to float

float

Example

This example uses the CEILING (SQL Server Compact 3.5) function to round off the unit price for products that are priced more than 100 dollars.

SELECT [Order ID], [Unit Price], CEILING ([Unit Price]) AS [CEILING]
FROM [Order Details]
WHERE [Unit Price] > 100
ORDER BY [Unit Price]