>>> use memb shared
>>> local array districts(3)
>>> scan
>>> if len(alltrim(zipcode)) = 10 then
>>> SELECT zipdist.cdist, zipdist.sdist, zipdist.hdist;
>>> FROM temptest!zipdist;
>>> INTO array districts;
>>> WHERE zipcode = memb.zipcode
>>[snip]
>>> So VFP is automatically using any indexes it needs? I wanted to be sure,
>>> because it runs SOOOO SLOOOOW. (930 records/min) .
>>the select should not run slow (assuming that you do have an index on zipcode for
>>zipdist)
>>maybe try to move memb.zipcode into a memory variable and use that
>>
>>Arnon
Try
SELECT zipdist.cdist, zipdist.sdist, zipdist.hdist;
FROM temptest!zipdist;
INTO array districts;
WHERE len(alltrim(zipcode))=10
Have an index on len(alltrim(zipcode)) tag ziplength