>select cpayment >SCAN FOR ((cpay_flag = .t.) and (!empty(cpay_schdate))) > replace cpay_schdate with {} > replace cpay_flag with .f. > if !cpay_update = 'D' then > replace cpay_update with "C" > endif > replace cpay_amt with 0.00 >ENDSCAN >I would guess you have an index on CPAY_FLAG or on EMPTY(CPAY_SCHDATE) and you are causing something I found in the VFP help for SET OPTIMIZE:
"In rare cases, you should disable Rushmore optimization. If a command that benefits from Rushmore optimization modifies a query’s index keys, the Rushmore record set may become outdated. You can disable Rushmore optimization to ensure that you have the most current information from the table."