select (case when @x - floor(@x) < 0.5 then floor(@x) when @x - floor(@x) > 0.5 then ceiling(@x) else @x end)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)