I'm assuming that you are looking for different records with the same address1 AND address2.
Try
SELECT ADDRESS1,ADDRESS2,COUNT(*) ;
from DONOR;
group by ADDRESS1,ADDRESS2;
order by 3 DESC;
into cursor temp
This will give you all the Address1's and Address2's and their respective counts in the DONOR table. The order by just makes it easier to look at what kind of numbers you have.
Perhaps I'm not quite understanding what you are trying to do, but your second query is really not needed. You have your duplicate addresses and how many duplicates of each pair in the cursor temp.
>I get the error 'Invalid key length' when :
>
>select a.ADDRESS1,a.ADDRESS2 from DONOR a group by a.ADDRESS1,a.ADDRESS2 having count(*)>1 into cursor temp
>
>select a.ADDRESS1 as ADDRESS1 from DONOR a ,temp b where a.ADDRESS1=b.ADDRESS1 and a.ADDRESS2=b.ADDRESS2 order by a.ADDRESS1,a.ADDRESS2 into cursor result
>
>I attemp to find out record with duplicate value of address1 and address2.
>The error locate at the second select statment.
>I have try
>- reindex the donor table
>- add 'where .t.' at the first select statement
>but still get the error. Why?
>
>Info: Address1 and Address2 are character fields of length 50.
>
>Thanks
>-Jasper
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place