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.layfrom 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.cinvcodewhere 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 sumquanfrom 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.cinvcodewhere a.ta003 between 'G1204-0001' and 'G1204-0001' 这个SQL语句怎么修改呢,让它该显示小数部分就显示小数部分,该取整的时候就取整呢.
- 4 回答
- 0 关注
- 948 浏览
添加回答
举报
0/150
提交
取消