What fields the customer and the sites are related on? Add that relation to the query.
>That's right, because the customer file is the head office table, and the sites are children of the customer file.
>
>How do I get around this ?
>
>>As I said in the previous message, you have duplicates in the customers or/and sites tables.
>>
>>>
>>>I take your advice on board, thx
>>>
>>>but I only have 4 records in LINEMARKINGHEAD, but the cursor has 39 records in it?
>>>
>>>>It's better to use JOINs and formatimg to make your query readable
>>>>
>>>>SELECT linemarkinghead.icustno, customers.ccompany, sites.name ;
>>>> FROM linemarkinghead ;
>>>> JOIN customers ON linemarkinghead.icustno = customers.icustno ;
>>>> JOIN sites ON linemarkinghead.siteno = sites.code ;
>>>> INTO CURSOR tmp
>>>>
>>>>
>>>>The only way you get more records by adding joins, if there're duplicate icustno in customers or/and code in sites.
>>>>
--sb--