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:56:05
 
 
À
24/08/2001 10:47:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00548638
Message ID:
00548646
Vues:
12
This message has been marked as the solution to the initial question of the thread.
How about this
INDEX ON State + Sequence + STR({^9999-12-31} - date) TAG MyTag
>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
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform