这么改试一下
cast(cast(obom_stru_expand2.total_qty as numeric(18,8))*(1+obom_stru_expand2.total_scrap_rate)/obom_stru_expand2.total_bom_divisor*(0.00100000) as numeric(18,8)) as qty,
cast(cast(obom_stru_expand2.total_qty as numeric(18,8))*(1+obom_stru_expand2.total_scrap_rate)/obom_stru_expand2.total_bom_divisor*obas_part1.bom_unit_rate as numeric(18,8)) as qty1 ,
cast(cast(obom_stru_expand2.total_qty as numeric(18,8))*(1+obom_stru_expand2.total_scrap_rate)/obom_stru_expand2.total_bom_divisor*(0.00100000) as numeric(18,8)) as qty,
cast(cast(obom_stru_expand2.total_qty as numeric(18,8))*(1+obom_stru_expand2.total_scrap_rate)/obom_stru_expand2.total_bom_divisor*obas_part1.bom_unit_rate as numeric(18,8)) as qty1 ,
调整一下:
cast(1.00 *
obom_stru_expand2.total_qty *
(1+obom_stru_expand2.total_scrap_rate) /
obom_stru_expand2.total_bom_divisor *
obas_part1.bom_unit_rate
as numeric(18,8)
) as qty1,
先单独把 obas_part1.bom_unit_rate 作为一列 select 出来看结果是不是 0.00100000 或者 obas_part1.bom_unit_rate 改为 convert(numeric(18,8),obas_part1.bom_unit_rate) 再试看看!!!
cast(obom_stru_expand2.total_qty*(1+obom_stru_expand2.total_scrap_rate)*obas_part1.bom_unit_rate/obom_stru_expand2.total_bom_divisor as numeric(18,8)) as qty1,
obom_stru_expand2.total_qty*(1+obom_stru_expand2.total_scrap_rate) as qtypart0,
obom_stru_expand2.total_bom_divisor,
obom_stru_expand2.total_qty*(1+obom_stru_expand2.total_scrap_rate)*(0.00100000) as qtypart1,
obom_stru_expand2.total_qty*(1+obom_stru_expand2.total_scrap_rate)*obas_part1.bom_unit_rate as qty1part1,
...值分别是多少?贴出来看看