>&SQLString="BETWEEN(num1,num2) AND INLIST(Filed,A,B,C,D) AND ALLTRIM(UPPER(STATE) = ALLTRIM(UPPER(STATE)) AND AND AND etc.." upto perhaps 20 criteria.
>
>SELECT Field1,Field2 - Field57;
>+WHERE t1.Key=t1.Key etc. etc.;
>+&SQLString;
>+etc... etc... INTO CURSOR MYCURSE. **(Pun Intended)**
>
Rick,
Do you have an index on ALLTRIM(UPPER(State))? If you don't then that criteria is not optimized. The index expressions must exactly meet the criteria. BTW, using ALLTRIM() in an index expression is a waste of time, as VFP will pad every item out to the field length.
Also for doing further selects from the cursor you need to add the NOFILTER option to your selects. With NOFILTER you won't need to use tables as the result.