以下是引用zengjun81357在2014-4-14 08:56:42的发言:
hu9jj班长说得对,repl 替换需要指明记录的,你加个条件 FOR odrep.month-odrep.pdtcode-odrep.spec-odrep.standn<>tg1-tg2-tg3-tg4
thank you
搞定了,很感谢
IF USED('odrep') THEN
SELECT odrep
ELSE
SELECT 0
USE odrep
ENDIF
LOCATE FOR odrep.month-odrep.pdtcode-odrep.spec-odrep.standn==tg1-tg2-tg3-tg4
IF FOUND()
axx=axx+1
REPLACE hamx.team WITH odrep.team,hamx.rep WITH odrep.rep,hamx.regbj WITH odrep.regbj,hamx.supbj WITH odrep.supbj,hamx.repbj WITH odrep.repbj,hamx.city WITH odrep.city,hamx.prov WITH odrep.prov
ELSE
LOCATE FOR odrep.month-odrep.pdtcode-odrep.spec-odrep.standn<>tg1-tg2-tg3-tg4
IF FOUND()
bxx=bxx+1
REPLACE hamx.team WITH '非目标',hamx.rep WITH '非目标',hamx.regbj WITH 'XX',hamx.supbj WITH 'X',hamx.repbj WITH 'XXX'
ENDIF
ENDIF
USE IN odrep
USE IN hamx
修改之后正确执行,这个问题我已经记在葵花宝典上了,以后遇到同样的情况就不会出错了