>I have the following SQL SELECT:
>
>
> SELECT a.client_num, a.NAME, a.DATE, a.price, a.client_src, ;
> b.ma_number AS ma_num, b.upin, b.dr_code AS drc, ;
> b.drv_code AS dvc, b.pr_author AS prior_auth, .T. AS SEND ;
> FROM ver a ;
> LEFT OUTER JOIN clients b ON a.client_num = B.client_num ;
> INTO ARRAY laWMA;
> WHERE ("WMA" $ a.client_src) ;
> AND (a.STATUS != "CXL") ;
> AND (a.STATUS != "NS") ;
> AND (NOT "C" $ a.meter) ;
> AND a.verified;
> AND NOT DELETED()
>
>
>After these are selected, they are copied into another table and deleted from the original table.
>
>This will work fine for "a while" (the number of times isn't consistant, but it's low, like 2-5), then there will be nothing in the array, even though trips that pass the WHERE are verified. If I PACK the table, it starts working again. Any ideas why this would act that way?
>
>BTW - This SELECT has been working fine for months, and just started this pattern of not working after a few runs.
>
>-Michelle
The DELETED() function is not reliable in SQL, because it reads from Current record of current alias.
Best way os to just set DELETED ON before the query.
Erik Moore
Clientelligence