The round
function rounds the number, but it leaves the data type unchanged:
ROUND(3.14,1) --> 3.10
By casting a number to numeric(x,1)
, you both round it and change it's data type to single digit precision:
CAST(3.14 as numeric(6,1)) --> 3.1
For your query, such a cast could look like:
select cast(sum(duration) as numeric(6,1))
But the eventual display format depends on the client. SQL Server Management Studio will display numeric(x,1)
with one digit behind the dot, but it is free to display it in another way. Formatting a number is best done client side, outside of SQL.