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
How to convert Decimal to Integer Format using sql query
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Rahul SinghRank #1,323 · 1.3K reputationPosted Jan 19, 2015, 11:58 PM EST
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
Khargesh RajputRank #616 · 3.9K reputationPosted Jan 20, 2015, 12:35 AM EST
what error u getting when using round