SQL – rounding to nearest 5
Had a requirement to round some price values to the nearest £5 in a SQL stored proc. It’s easy to round to the nearest 10 using a negative value for the length parameter of the ROUND function i.e. [sql]select round(12, -1)[/sql] returns 10 [sql]select round(16, -1)[/sql] returns 20 but length must be of type tinyint, Read more about SQL – rounding to nearest 5[…]