Right, and I CCed Rich with my two liner solution.
>I'm not sure what you're trying to tell me and I can not try anything here, I don't have VFP.
>
>Anyway, the point is that it can not be done with IN or EXISTS in one line and has to be done in two steps in VFP8.
>
>>I updated my answer before your reply. Anyway, try this two liner
>>Select * From (lcFile) Into Cursor curDummy Readwrite Where activity="Passed - waiting for source"
>>Select * From (lcFile) Inner Join curDummy On &lcFile..rma=curDummy.rma Into Cursor (lcFile) Readwrite
>>
>>>You're missing the point that we don't know RMA. That was just a sample. We need to get all the records that have the same rma as the one with "Passing date"
>>>
>>>Since Rich is using VFP8 the only way would be to do in two steps. In VFP9 syntax with derived tables work fine, but IN and EXISTS don't work.
>>>
>>>>You've got it all wrong, your query will give the same result as Sergey's. This query will give the data you want:
>>>>SELECT * FROM (lcReturn) ;
>>>> WHERE RMA=3 AND EMPTY(date_end) ;
>>>> INTO CURSOR (lcReturn)
>>>>Or am I missing something?
>>>>