sql server - Getting wrong result when using bigint in sql query -
i have passed below amountdue in query getting wrong result. amountdue data type float.
amountdue: 2412880.28 amountdue: 561.06
my query:
select convert(varchar,(select convert(bigint,amountdue*100))) dbo.tblbidresults
i getting below results wrong:
241288027 56105
correct result:
241288028 56106
try converting numeric instead of bigint:
declare @temp float set @temp = 2412880.28 select convert(varchar,(convert(numeric(27,0),@temp*100)))
there good post goes on reason here.
Comments
Post a Comment