C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Rounding numbers in MS SQL


Posted Date: 17 Jul 2008    Resource Type: Code Snippets    Category: SQL
Author: ProgrammerMember Level: Gold    
Rating: Points: 4



In MS SQL, numbers can be rounded using Round () function.
For Example,


SELECT ROUND(178.49, 0)


The above query returns 178.00


SELECT ROUND(178.50, 0)


The above query returns 179.00.If the number after the decimal point is greater than 49 then it increments the number by 1.


SELECT ROUND(178.1234, 1)


The above query returns 178.1000.The first number after the decimal point is considered and rest of the numbers are neglected.


SELECT ROUND(178.1234, 2)


The above query returns 178.1200.The first two numbers after the decimal point are considered and rest of the numbers are neglected.









Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Using Round() function  .  Using Round function in SQL  .  Using Round function  .  Rounding Numbers in SQL  .  Microsoft MS Sql  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Find Difference Between Two Dates using MS SQL
Previous Resource: how to select last inserted record in sqlserver2005
Return to Discussion Resource Index
Post New Resource
Category: SQL


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use