SELECT DISTINCT &lcField FROM DocsMast ; ORDER BY &lcField ; INTO CURSOR TreeInitThe following code runs in less than 1 second:
SELECT DISTINCT &lcField FROM DocsMast ; INTO CURSOR TreeInit INDEX ON UPPER(&l_cField) TAG SortedWhy? Is there a way to get the result ordered without having to do a manual INDEX or wait for 30+ seconds? I gather that VFP is applying the ORDER BY to the entire table before applying the DISTINCT clause.