Search

Tuesday, January 3, 2012

Using Round and Truncate


MS SQL Round function returns a rounded valute to the specified lenght. It coud be used for rounding as well as for truncating a value.
Rounding Example:
SELECT CAST( ROUND(10304.426,2) AS MONEY) as ValueROUNDED
Truncating Example:
SELECT CAST( ROUND(10304.422,0,1) AS MONEY) as ValueTRUNCATED
More about Rounding and Truncating values can be found on MSDN:
http://msdn2.microsoft.com/en-us/library/ms175003.aspx

No comments:

Post a Comment