试图弄清楚为什么在创建要执行的字符串时出现此错误
SET @SQLINSERTSTRINGFINAL = @SQLINSERTSTRING + @Suggested_Qty+''','''+
@Required_Qty+''','''+
@System_Cost+''','''+
@Revised_Cost
这 4 个变量来自
convert(numeric(7,2),ltrim(rtrim(floor((case when r.calc_qty > 99999 then 99999 else r.calc_qty end)/(case when s.PLBCF_1 is null or s.PLBCF_1 =0 then 1 else s.PLBCF_1 end))))),
convert(numeric(7,2),ltrim(rtrim(floor((case when r.po_number <> 'NONE' then r.calc_qty else case when r.adj_qty > 99999 then 99999 else r.adj_qty end end)/(case when s.PLBCF_1 is null or s.PLBCF_1 = 0 then 1 else s.PLBCF_1 end))))),
convert(numeric(9,4),ltrim(rtrim(case when s.std_cost is null then r.std_cost else s.std_cost end))),
convert(numeric(9,4),ltrim(rtrim(r.std_cost)))
我检查了使用的每个表,它们在列类型中是一致的。只有非数字的 r.po_number 可以是 'NONE'