>>SELECT Bedrijf.DossierNr, ;
>> UPPER(Bedrijf.BedrNaam), ;
>> UPPER(Straat.Om), ;
>> ALLTRIM(Bedrijf.Nummer), ;
>> StatBedr.Om_NL, ;
>> VestType.Om_NL ;
>>FROM Bedrijf, ;
>> Straat, ;
>> StatBedr, ;
>> VestType ;
>>WHERE Bedrijf.Straat = Straat.Straat ;
>> AND Bedrijf.StatBedr = StatBedr.StatBedr ;
>> AND Bedrijf.VestType = VestType.VestType ;
>> AND &mSeekDosNr ;
>> AND &mSeekBedrNm ;
>> AND &mSeekHandNm ;
>> AND (&mSeekBranch1 ;
>> OR &mSeekBranch2 ;
>> OR &mSeekBranch3 ;
>> OR &mSeekBranch4 ;
>> OR &mSeekBranch5) ;
>> AND &mSeekStraat ;
>> AND &mSeekStatus ;
>> AND &mSeekDatIns1 ;
>> AND &mSeekDatIns2 ;
>>ORDER BY 2 ;
>>INTO CURSOR Result
>
>Firstly, using UPPER,ALLTRIM you slow down the query.
Yup.
>Secondly, you have too many filter conditions.
Yup yup...and the OR's are killing you. There is a documented bug that if you put OR's in your WHERE's your performance will degrade with each execution. You may want to put the OR's in a HAVING clause...
...and make sure you have an index on every field where you have an = sign .