Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index on descending dates as part of expression
Message
From
24/08/2001 10:47:51
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Index on descending dates as part of expression
Miscellaneous
Thread ID:
00548638
Message ID:
00548638
Views:
40
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
Next
Reply
Map
View

Click here to load this message in the networking platform