SID Desc PID LX >>1....A....0....0 >>3....B....1....1 >>5....C....3....2 >>7....D....5....3 >>8....E....14...3 >>14...F....3....2 >>21...G....3....2 >>22...H....21...3>>
SID Desc PID LX >>1....A....0....0 >>3....B....1....1 >>5....C....3....2 >>7....D....5....3 >>14...F....3....2 >>8....E....14...3 >>21...G....3....2 >>22...H....21...3>>
SELECT Sid, Desc, Pid, Lx ; FROM MyTable ; INTO CURSOR MyCursor ; ORDER BY Sid, Desc, Pid, LxMatthew - be sure to re-arrange the field names and ordering, and to test with enough repeating fields to get what you want.