select table2 && Note, that we need to open table2 only once, not in the scan append from dbf("crsRand") select crsRand scan goto rn in Table1 && move record pointer to rn record in table1 delete in Table1 endscan *delete from table1 where recno() in (select rn from crsRand) *use in crsRand && we do not need our crsRand anymorethanks