>>>select KeyID, count(*) as CntDups from yourtable group by KeyID ; >>> having CntDups > 1 ; >>> into cursor curDupes >>>if _tally>0 && There are dups in table >>> index on KeyID tag KeyID >>> scan >>> if seek(KeyID,'YourTable',"KeyID") && should be always found >>> * select YourTable >>> delete in YourTable && One duplicated record is deleted now >>> endif >>> endscan >>>endif >>>use in curDupes >>>>>Looks like it'll work for one duplicate per KeyId. What if there're more than one?