ABS (SQL Server Compact)
Returns the absolute, positive value of the given numeric expression.
ABS ( numeric_expression )
Is an expression of the exact numeric or approximate numeric data type categories, or types that are implicitly convertible to
Returns the same type as
numeric_expression except for the following expressions:
Nonnumeric types that can be implicitly converted to
The following example returns the absolute value of the difference between the number of products in stock and number of products that have been ordered.
SELECT [Units In Stock] - [Units On Order] AS Expr1, ABS([Units In Stock] - [Units On Order]) AS Expr2
SELECT [Units In Stock] - [Units On Order] , ABS([Units In Stock] - [Units On Order])
Did you find this helpful?
( 1500 characters remaining)
Thank you for your feedback