-- Rounding Off to 0.5
SELECT 8.4 Value,
CASE
WHEN 8.4 % 1 >= 0.5 THEN 8.4 - 8.4%0.5
ELSE Round(8.4, 0)
END FinalValue
SELECT 8.9 Value,
CASE
WHEN 8.9 % 1 >= 0.5 THEN 8.9 - 8.9%0.5
ELSE Round(8.9, 0)
END FinalValue
--Rounding Off to 0.0 and getting rounded value
SELECT 8.4 Value,
Round(8.4, 0) - 8.4 RoundedOff,
Round(8.4, 0) FinalValue
SELECT 8.9 Value,
Round(8.9, 0) - 8.9 RoundedOff,
Round(8.9, 0) FinalValue
No comments:
Post a Comment