日期:2014-05-18 浏览次数:20518 次
cast((cast(((iDiameter + 0.5) * 2) + 0.9999 as int))/2 as dec(18,2))
------解决方案--------------------
少了一个0.9999
(cast((cast(iDiameter as decimal(16,2))+0.5) * 2 + 0.9999) as int)/2
------解决方案--------------------
--是不是这个意思? declare @iDiameter int set @iDiameter=100 select cast(round((cast((2*@iDiameter+1) as decimal(18,4))+0.9999)/2,2) as decimal(18,2)) /* 101.00 */