>SELECT * FROM Facture WHERE (FA_GENRE = "FA") AND ; > (ABS(FA_TOTAL) > ABS (FA_ZPAYED)) INTO TABLE Tmp ORDER BY CL_Code > >* It now takes 28.25 seconds > >What do you think? > <hr> Let's try an index on ABS(FA_TOTAL) - ABS(FA_ZPayed) called Balance SELECT * FROM Facture ; INTO TABLE Tmp ; WHERE FA_GENRE = "FA" AND ; ABS(FA_Total) - ABS(FA_ZPayed) > 0 ; ORDER BY CL_CODE
>>SELECT * FROM Facture WHERE (FA_GENRE = "FA") AND ; >(ABS(FA_TOTAL) > ABS(FA_ZPAYED)) INTO TABLE Tmp ORDER BY CL_Code >>The thing is you cannot ask SQL to use a specified index. VFP will determine which index to use based on the SQL conditions. To have Rushmore work with the above SQL, you will need a non-filtered index on: