Hi Borislav
>You could do this joing two ways:
>1. Use derived table with exact the same SELECT as first SPT cursor:
>...
>2. Select records w/o joining and than select jojned records using both SPT cursors in VFP.
>I personaly prefer first suggestion, because it is faster and you get all records you need directly.
Yes the first one worked perfectly. I was able to reuse the SQL statement, which was important just in case the SQL #1 should be ever changed. I had first tried a LEFT JOIN but one of the fields would not allow a NULL value so I did a simple JOIN will it affect the result set?
I was worried as the original WHERE clause was pretty complex but that did not seem to be an issue. The problem I did encounter was due to an ORDER BY in SQL #1, which I removed and put it into a VFP SELECT on cursor #1.
All in all it worked wonders. Thanks a lot.