>This query does not return any results, but I know the temp cursor has deleted records that are in the real table.
>
>
> Select * from JobItems where ipkey in (Select ipkey From csrTempJobItems Where Deleted()=.T.)
>
>
>If I run the subquery by itself, I do get the desired results for the subquery, so I do not understand why it does not work in the full query shown above:
>
> Select ipkey From csrTempJobItems Where Deleted()=.T.
>
If you split this in two selects:
Select ipkey From csrTempJobItems Where Deleted()=.T. into cursor cDeleted nofilter
select * from JobItems where exists (select 1 from cDeleted where cDeleted.IpKey = JobItems.JpKey)
would it return the result?
Though I agree with Sergey that it may be better to use a different field to mark deleted records.
If it's not broken, fix it until it is.
My Blog