这么改试一下
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   , 

解决方案 »

  1.   

    obas_part1.bom_unit_rate 是整型的字段吧?
    调整一下:
    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, 
      

  2.   

    不是整型的,是NUMERIC(18,8)
      

  3.   

     
    先单独把 obas_part1.bom_unit_rate 作为一列 select 出来看结果是不是 0.00100000 或者 obas_part1.bom_unit_rate 改为 convert(numeric(18,8),obas_part1.bom_unit_rate) 再试看看!!!
      

  4.   

    已经SELECT  obas_part1.bom_unit_rate   的值了,是0.00100000
      

  5.   

    Try(先乘后除):cast(obom_stru_expand2.total_qty*(1+obom_stru_expand2.total_scrap_rate)*(0.00100000)/obom_stru_expand2.total_bom_divisor as numeric(18,8)) as qty, 
    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, 
      

  6.   

    Try(先乘后除): 此方法不行。
      

  7.   

    ...
    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,
    ...值分别是多少?贴出来看看