Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Index on descending dates as part of expression
Message
De
24/08/2001 10:47:51
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Index on descending dates as part of expression
Divers
Thread ID:
00548638
Message ID:
00548638
Vues:
38
I know I'm missing something simple here and I'll hate myself when the solution gets posted but............

I have a table of document names which need to be sorted by date (descending) within sequence (ascending) within state (ascending). I process one state at a time and was able to
SELECT * FROM mytable ;
 WHERE state = m.myState ;
 ORDER BY sequence, eff_date DESC ;
 INTO CURSOR myCursor
At first I tried doing it by creating an index expression which would allow me to
 SEEK m.myState
SCAN WHILE mytable.state = m.myState 
etc.
but I never could get the index expression quite right. The sorted table should look like
State  Sequence  Eff_date       Other Fields
AL         1     01/02/2002     ..............
AL         1     01/02/2001     ..............
AL         1     01/02/2000     ..............
AL         2     01/02/2000     ..............
AL         3     01/02/2001     ..............
AL         3     01/02/2000     ..............
NY         1     01/02/2001     ..............
TX         1     01/02/2001     ..............
TX         1     01/02/2000     ..............
TX         2     01/02/2000     ..............
TX         2     01/02/1999     ..............
                   etc.
Thanks to all........Rich
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform