1 > 添加时去重 ,数量汇总
long ll_rowcount,i,ll_find,ll_newrow
string ls_spdm
dec ld_sl
ll_rowcount=dw_1.rowcount()
for i=1 to ll_rowcount
ls_spdm=dw_1.object.spdm[i]
ld_sl=dw_1.object.sl[i]
if dw_2.rowcount()>0 then
ll_find=dw_2.find("spdm=‘"+ls_spdm+"‘",1,dw_2.rowcount())
//发现同时累加数量
if ll_find>0 then
dw_2.object.sl[ll_find]=dw_2.object.sl[ll_find]+ld_sl
else
ll_newrow=dw_2.insertrow(0)
dw_2.setitem(ll_newrow,‘spdm‘,ls_spdm)
dw_2.setitem(ll_newrow,‘sl‘,ld_sl)
end if
else
ll_newrow=dw_2.insertrow(0)
dw_2.setitem(ll_newrow,‘spdm‘,ls_spdm)
dw_2.setitem(ll_newrow,‘sl‘,ld_sl)
end if
next
时间: 2024-10-12 21:23:00