有如下代码块:Dim SQLxs,sqlA,sqlB As String
For Each pp As String In ppjhs
sqlA = " union all SEL ECT 单号,日期,a.条码,商品,色号,尺寸,数量,标准价,(Case when 数量 = 0 Or 标准价=0 Then 0 Else Round(成交金额 / (数量*标准价),2 ) End) As 折扣," & _
"( Case when 数量 = 0 Then 0 Else Round(成交金额 / 数量,0) End) As 成交价,成交金额,(数量*标准价) As 标准金额,系列,业务员,年代,季节,波段,大类,小类,品名,颜色别名,尺寸名,店铺,备注 Fr om {@销售记录表} as a INNER JOIN {@商品表} as b ON a.条码 = b.条码 where $ "
SQLB = sqlA.replace("@",pp)
SQLxs & = SQLB
Next
希望写入全局代码,最终获得SQLxs,可以吗?