I'm not sure what 'static values' means. If they never change, you can make them a part of a query. You can also use ASCAN(). Either one could be slower than storing values in a cursor and JOIN, though.
Select * ... Where Sales.Person In ("1 ", "23 ", "165 ")
...
Select * ... Where ASCAN(Thisform.aSales[3], Sales.Person, ...)
>
>Thanks for the info.
>
>Is there any way to create a query that filters on static values
>
>Example:
>
>Declare Thisform.aSales[3] = 3
>Thisform.aSales[1] = "1 "
>Thisform.aSales[2] = "23 "
>Thisform.aSales[3] = "165 "
>
>Select * ... Where Sales.Person In Thisform.aSales
>
>
>>
>>A JOIN is usually faster in VFP query than IN.
>>Make sure that you have index on the 'Item' field. You can also try index on 'amount '.
>>If periodV table has significant # of records, you may also try to index on 'cid ' field in it.
>>
>>SELECT DISTINCT Sales.Person ;
>> FROM Sales ;
>> JOIN periodV ON Sales.fk_period = periodV.cid ;
>> WHERE Sales.Item = theItem ;
>> AND Sales.amount <> 0.00 ;
>> INTO CURSOR doamt
>>
--sb--