Karl Blessing
Programmer
I have a table that has 2 fields I want to order by<br>but has relations to another 2 <br><br>for example lets say we had<br><FONT FACE=monospace><br>HI LI HP LP<br>1 ¦ 1 ¦ 0 ¦ 0<br>2 ¦ 1 ¦ 0 ¦ 0<br>3 ¦ 1 ¦ 0 ¦ 0<br>3 ¦ 2 ¦ 3 ¦ 1<br>3 ¦ 3 ¦ 3 ¦ 2<br>3 ¦ 4 ¦ 3 ¦ 2<br>3 ¦ 5 ¦ 3 ¦ 1<br>4 ¦ 1 ¦ 0 ¦ 0<br>4 ¦ 2 ¦ 4 ¦ 1<br><i>H=Header, L=Leaf, I=ID, P=Parent</i><br></font><br><br>ok I want that kind of order about, parents cominning first, then it's children, then the children of the other child before it gets to the next parent for example the above could be<br><FONT FACE=monospace><br>(1,1)<br>(2,1)<br>(3,1)<br> ¦<br> -(3,2)<br> ¦ ¦<br> ¦ -(3,3)<br> ¦ -(3,4)<br> -(3,5)<br>(4,1)<br> ¦<br> -(4,2)<br></font><br>I want to read down as if it were a fully expaned treee, and have it sorted like it is above, so that when I read row by row of the recordset, I can just read it's HP/LP and see if I need to tab it over, or what relations to the one above it to set in my ASP, that way I wont have to figure out how to create a Rescursive VBscript function, that might require 4 or 5 open recordsets during a stack.<br><br>if anyone knows how I Can use the OrderBy to help me acheive this let me know. ( I Can change the 0,0 to like 1,0 and 2,0 if that helps in the process ) <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>