thank you for reply,
it works,You'r welcome.
i need another things ,i want to add the total of tel.lines to another field(count2)
via code under.
as..
clint_no(ncli) telno count 1 count 2
1 555 3 0
1 444 3 0
1 666 3 3 this is what i need to add to (mytable.count2)
2 555 6 0
. . . .
. . . 6 this is what i need to add to (mytable.count2)
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.telnoNot sure I understand exactly what you are asking, but if you just want the total telnos for all customers:
SELECT Active
REPLACE MyTable.Count2 WITH RECCOUNT()
or, if you have deleted records in active:
SELECT COUNT(TelNo) FROM Active WHERE NOT DELETED() INTO ARRAY laTelNos
REPLACE MyTable.Count2 WITH laTelNos[1]
HTH
Jim
Jim