ta021 列 为 decimal(18,4) 类型
select a.ta001,a.ta002,d.cinvcode,case b.ifint when 0 then a.ta021*1.0000*d.de1/d.de2*(1.0000+d.de3/100.0000-d.de4/100.0000)
when 1 then ceiling(a.ta021*1.0000*d.de1/d.de2*(1.0000+d.de3/100.0000-d.de4/100.0000)) end as sumquan,
a.ta003,a.lay
from Cmocta a left join cbom c on a.cinvcode = c.cinvcode left join cbomson d on c.bomid=d.bomid
left join ainventory b on d.cinvcode=b.cinvcode
where a.ta003 between 'G1204-0001' and 'G1204-0001'
以上SQL语句 sumquan 全部自动取整了,好奇怪.
如果换成以下SQL语句,是会显示小数的,
select b.ifint,case b.ifint when 0 then a.ta021*1.0000*d.de1/d.de2*(1.0000+d.de3/100.0000-d.de4/100.0000)
when 1 then ceiling(2) end as sumquan
from Cmocta a left join cbom c on a.cinvcode = c.cinvcode left join cbomson d on c.bomid=d.bomid
left join ainventory b on d.cinvcode=b.cinvcode
where a.ta003 between 'G1204-0001' and 'G1204-0001'
这个SQL语句怎么修改呢,让它该显示小数部分就显示小数部分,该取整的时候就取整呢.
噜噜哒
RISEBY
红颜莎娜
潇潇雨雨
相关分类