>>>With NOFILTER (and deleted still off), yes, all records are returned and the deleted flag is wiped regardless of any other setting.
>>>
>>>What I haven't tested yet is whether or not it speeds up the query. That's my next step.
>>>
>>I have skipped most of the thread so pls forgive if I am totally off target:
>>Since you seem to use SQL-Select, would not something like
>>Select *, deleted() as lWasdeletd from ...
>>fill your need the keep the info on the deleted() status of the base table for your next steps ?
>>
>>regards
>>
>>thomas
>
>Looks like this is going to be the best option. I just discovered something more about this whole process which means I can't use my own method in a consistent way anyway.
>
>This is the problem.
>
>With SET DELETED OFF:
>
>
SELECT id, firstname, lastname FROM tablename INTO CURSOR crsTemp
>Will return deleted records with the deleted flag still set. However,
>
>
SELECT id, UPPER(firstname), UPPER(lastname) FROM tablename INTO CURSOR crsTemp
>Will wipe out the deleted flag.
That's the kind of risky behavior we were warning you about.
>
>UPPER() is just for illustrative purposes. Any function, or adding < something as field > in the select will wipe out the deleted flag. In some instances in this code, functions are used. So, it looks like your method is about the only way I can do what I need to.
>
>Thanks for the suggestion. So, the above then becomes:
>
>
SELECT id, UPPER(firstname), UPPER(lastname), DELETED() as deletedrec ;
>FROM tablename INTO CURSOR crsTemp
>And it works.
>
It will only work as long as you select from only one table. The minute you join in another table, it will fail to work again.