If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Database Result Grouping.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-04, 15:28
kefka1911 kefka1911 is offline
Registered User
 
Join Date: Oct 2004
Posts: 3
Exclamation 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.
Reply With Quote
  #2 (permalink)  
Old 10-28-04, 16:56
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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>")
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On