Select 6 && you should use the alias name of the table/cursor instead of the && workarea number. This makes code more readable by a performane hit of && some nanoseconds, you'll never will notice a difference in speed, && but readability/maintainability is HIGHLY improved Replace dr With 0 All Replace cr With 0 All && UPDATE yourCursorName SET dr = 0, SET cr = 0 && is far faster since it will place only one lock at the table header && REPLACE will lock any record once, and since you've 2 replaces it will && lock each record twice. && I use replace command only to REPLACE one or several fields on ONE record, && and if you use REPLACE command always this way REPLACE field1 WITH someValue, field2 WITH someOtherValue && instead of several single REPLACE's ... Goto Top Do While !Eof() Replace dr With opdr Replace cr With opcr Enddo && there a special command in VFP named SCAN that exactly does the above .. SCAN IN aliasName && will automatically issue a GO TOP IN aliasName && somecode ... ENDSCAN && will automatically issue a SKIP on the correct table/cursor && as already mentioned a SCAN (loop over every record in table) with only && REPLACE commands in it can be rewritten most && of the time as an UPDATE SQL statement .. which should always be faster && since you change the dr & cr fields again I && don't see the intend on setting them to 0 at the beginning of the code && since they are overwritten again anyway ?!Serg already answered the rest of the conversion to a SELECT & UPDATE query.