Alex Rivera | Logout

T-SQL average rounded to the closest integer

Asked 2011-08-15T10:33:31.823
15

I'm not sure if this has been asked before, but how do I get the average rounded to the closest integer in T-SQL?

Edit
Report

1 Answer

8

This worked for it:

CONVERT(int,ROUND(AVG(CAST(COLUMN-NAME AS DECIMAL)) ,0))

Isn't there a shorter way of doing it though?

answered 2011-08-15T10:46:50.730

Your Answer