I have worked with this a couple of times, and got it to work using an Array, but I wanted to try it in a different way. Basically I have a query that would give me these DB results:

ID CODE DESCRIPTION1 POS SORTER DATE
---- ------ ---------------- ----- -------- ------
WEB 2003SP Spring 2003 1 1 1-1-2003
WEB 2003FL Fall 2003 2 1 8-1-2003
WEB 2003SU Summer 2003 3 1 5-1-2003
WEB 2003Q1 Quarter 1 2003 4 2 1-1-2003
WEB 2003Q2 Quarter 2 2003 5 2 4-1-2003
WEB 2003Q3 Quarter 3 2003 6 2 7-1-2003
WEB 2003Q4 Quarter 4 2003 7 2 10-1-2003

So, what I was wanting to do now, is use these results to populate my HTML table. Here is how I was looking at populating the table (take a look at the comments in the code):

Code:
   <table>
    <tr>
      <td>Terms</td>
      <td>Date</td>
    </tr>
    <tr>
      <td colspan="2">UG Terms</td>
    </tr>
    <tr>
      <td>All Sections</td>
    <tr>
      <td>  <!-- HERE I WOULD WANT TO PRINT ALL TERMS WHERE SORTER = '1' --></td>
    </tr>
    </tr>
    <tr>
      <td>Other Sections</td>
    </tr>
    <tr>
      <td><!-- HERE I WOULD WANT TO PRINT ALL TERMS WHERE SORTER = '1' --></td>
    </tr>
    <tr>
      <td>Winter</td>
    <tr>
      <td><!-- HERE I WOULD WANT TO PRINT ALL TERMS WHERE SORTER = '1' and REPRESENTATION.substring(0,5) = 'Spring' --></td>
    </tr>
    </tr>
    <tr>
      <td>Summer</td>
    <tr>
      <td><!-- HERE I WOULD WANT TO PRINT ALL TERMS WHERE SORTER = '1' and REPRESENTATION.substring(0,5) = 'Summer' --></td>
    </tr>
    </tr>
    <tr>
      <td colspan="2">Other Terms</td>
    </tr> 
    <tr>
      <td>All Sections</td>
    </tr>
    <tr>
      <td><!-- HERE I WOULD WANT TO PRINT ALL TERMS WHERE SORTER = '2' --></td>
    <tr>
  </table>
So again, Where the comments are is how I want to fill out the table, I am thinking this is possible, and I was just wondering how to go about doing this. Thanks for the help, and if more info is needed, please let me know.