SELECT Left(State.Reg_Code,3) AS Reg_Code ; FROM State ; WHERE Left(State.Reg_Code,3) NOT IN ( ; SELECT ccRegion.Reg_Code FROM ccRegion) ; INTO CURSOR crsNewCodes SELECT ccRegion APPEND FROM ( DBF("crsNewCodes") ) ...>
>Select State >Go Top >Select ccRegion >Do While !Eof("State") > > Locate For ccRegion.Reg_Code = State.Reg_Code > If !Found() > Append Blank > Replace ccRegion.Reg_Code With Left(State.Reg_Code,3) > =TableUpdate(.T., .T., "ccRegion") > EndIf > Skip 1 In State >EndDo >>