>>>Yes, this Select should be splitted on two, the first one will do Select Distinct ... Into Cursor..., and next one will join the cursor.
>>
>>Not necessaraly. You can do the same if you move JOIN into where condition like
>>
>>where ResNum in (select distinct ResNum from ...)
>
>Only if all final recordset fields come from the same source.
Yes and luckily this is the case here.
If it's not broken, fix it until it is.
My Blog