>Bruce,
>
>>I have some very large tables from which I have to get records NOT IN other very large tables. Code like this:
>
>>select * from table1;
>>where keyfield NOT IN;
>>(select keyfield from table2)
>
>how about
>
>USE TABLE1
>USE TABLE2 ORDER TAG keyfieldTag
This needs an IN 0 clause at a minimum. Geez, if you're gonna post bad xBASE, at least make the bad xBASE code workable and correct. As posted, only TABLE2 is open - you've gone and USEd it in the same workarea as TABLE1. The joys of xBASEism...
>
>SET RELATION TO Keyfield INTO Table2
>
In order to activate the relation, you need to shift the record pointer (even if back to itself) so adding a GO TOP or LOCATE here might be appropriate.
>BROWSE NORMAL FOR EOF("Table2")
>
I seriously doubt that Bruce wants to cruise the file in a Browse, but YMMV.
>You might want to copy this into a temp table
>
>COPY TO Temptable EOF("Table2")
Your coding is extremely consistent. You need a FOR just prior to the conditional expression.