how can we convert negative a number to positive number in SQL Server 2005/2008.
3 Comments |
7948 Views | Post by: Admin
ABS function, negative a number to a positive number, use ABS function
In this post, We will learn to convert a negative number to positive number. ABS function is the SQL function, which will convert the negative number to positive one.The example can be create in any edition of Ms-SQL Server like MS-SQL Server 2005/2008. A SQL Script has been attached with the article.
If we wan to convert a number to positive number then we can use the ABS function hwich will convert the negative number to positive one.
Follow the following below steps to convert a negative a number to positive number in SQL Server 2005/2008
Step1: Open the SQL Server 2008 Edition
Step 2: Create a new script(test databse or select any pre created database for the testing purpose )
Step 3: Write the following SQL statement, I have used the ABS function there to a number to positive number in SQL Server 2005/2008
SELECT ABS(-2.0) -- NEGATIVE VALUES
Step 4: Output as we needed.
so guys, we have learned in this tutorial, how we can convert negative a number to positive number in SQL Server 2005/2008.
Download Source Codes