SELECT ncli, COUNT(ncli) AS telno FROM active ; GROUP BY 1 INTO CURSOR telno READWRITE INDEX ON ncli TAG ncli SELECT active SET RELATION to ncli INTO telno REPLACE ALL active.Count1 WITH telno.telno *************************************************** USE active m.ncli=ncli INDEX ON ncli TO hh DO WHILE .t. m.ncli=ncli SET FILTER TO ncli=m.ncli GO bottom REPLACE active.Count2 WITH Count1 set filter to SKIP IF EOF() EXIT ENDIF enddothanks.