> Hello all
>
> I have the folowing select statment in the init event of a form and it takes "forever" to display the data, (about 150000 record in the table). Only one table is involved in the query and it has a primary index on salesno field. I tried sys(3054,11) and it says that rushmore optimization is none. How can I speed up this query.
>
>
>
thisform.grid1.recordsource = "SELECT Sale.salesno, Sale.saledate,Sale.custid, Sale.empid, Sale.total FROM salesclerk!sale where Sale.sus <> .T. and Sale.saledate == thisform.date ORDER BY Sale.salesno DESC into cursor viewreprint"
>
> cheers
> smith
thisform.grid1.recordsource = ;
"SELECT salesno, saledate,custid, empid, total"+;
" FROM salesclerk!sale"+;
" where Sale.saledate == thisform.date and !Sale.sus"+;
" ORDER BY salesno DESC into cursor viewreprint"
At least have an index on saledate. Having a binary index on "sus" and deleted() might help further (but test it first, it might work against you as well).
Cetin Basoz