Monday, April 25, 2011

SQL ROUND() Function


The ROUND() Function

The ROUND() function is used to round a numeric field to the number of decimals specified.

SQL ROUND() Syntax


SELECT ROUND(column_name,decimals) FROM table_name



SELECT Cast(Round(123.456,2,1) as decimal(18,1))
123.4
SELECT Cast(Round(123.456,2,1) as decimal(18,0))
123

No comments :

Post a Comment