I want to round my Amount value from Decimal to Integer Format in sql query.
if amount 65.33 then amount=65
if amount 65.53 then amount=66
i tried with round function. but not getting expected result.
I am a fresher.please help.Thanks in advance
Loading
Khargesh RajputPosted Jan 20, 2015, 5:35 AM
what error u getting when using round
Rahul SinghPosted Jan 20, 2015, 4:58 AM
DECLARE @Value DECIMAL(5,2)
SET @Value = 65.53
SELECT FLOOR(@Value) + CASE WHEN SIGN(0.5-(@Value-FLOOR(@Value))) >0
THEN 0 ELSE 1 END