Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    3

    Exclamation Unanswered: Database Result Grouping.

    Hello there, I am building an intranet web page using ASP that searches an Access DB. In the Database I have a field that contains dublicate words. For Ex.
    [ SUBJECTS][ORG_LEVEL_1]
    -------------------------------------
    [Abuse ][Womens Abuse Society ]
    [Abuse ][Childrens Abuse Center ]
    [Baseball ][Newmarket Baseaball Ass.]

    When I do a search, My current Script shows the results just as it is shown there, what I would like is for it to show like this.

    [Abuse ][Womens Abuse Society ]
    [Childrens Abuse Center ]
    [BaseBall ][Newmarket Baseball Ass. ]

    Thanks in Advance.

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    So you do something like this....
    Code:
    Dim currentSubject
    currentSubject=""
    Response.Write("<table>")
    Do while not myRecordset.eof
      response.write("<tr>")
      if myRecordset("Subject") <> currentSubject then
        Response.Write("<td>" & myRecordset("Subject") & "</td>")
      else
        Response.Write("<td></td>")
      end if
      Response.Write("<td>" & myRecordset("Org_Level_1") & "</td>")
      response.write("</tr>")
      myRecordset.MoveNext
    Loop
    Response.Write("</table>")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •