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............
SELECT * FROM mytable ; > WHERE state = m.myState ; > ORDER BY sequence, eff_date DESC ; > INTO CURSOR myCursor>
SEEK m.myState >SCAN WHILE mytable.state = m.myState >etc. >>
>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. >>