I'm am working with ASP and I'm am filtering results from an Access DB.
I have the season, year and designer stored in the Database.
Example:
Designer | Season | Year | Url
Paul Smith | AW | 07 | /aw07/menswear/paul_smith
Paul Smith | SS | 07 | /ss07/menswear/paul_smith
Paul Smith | AW | 06 | /aw06/menswear/paul_smith
Paul Smith | SS | 06 | /ss06/menswear/paul_smith
...and so on back to SS85
Paco Rabanne | AW | 07 | /aw07/menswear/paco_rabanne
Paco Rabanne | SS | 07 | /aw07/menswear/paco_rabanne
...and so on
My query looks for all Fashion Designers in Menswear Where the first letter of their name has been specified by the user. e.g. search = P
I would like to format thes returned results grouped by designer and to display the most recent 4 seasons out of a long list. e.g. AW07, SS07, AW06, SS06. Each season is a link.
I can group the results but I only want my dividers ' | ' to show between the seasons and not after the last result.
Currently my results return like this:
Paul Smith
aw07 | ss07 | aw06 | ss06 |
Paco Rabanne
aw07 | ss07 | aw06 | ss06 |
Pierre Henri Mattout
aw07 | ss07 | aw06 | ss06
and I would like it to look like this...
Paul Smith
aw07 | ss07 | aw06 | ss06
Paco Rabanne
aw07 | ss07 | aw06 | ss06
Pierre Henri Mattout
aw07 | ss07 | aw06 | ss06
Where do I need to edit within my array to recifiy this?
My Code
Expand|Select|Wrap|Line Numbers
- <%
- Dim ar, CurrentDesigner, NextDesigner
- Dim sOutPut
- If Not RS_designerLetter.EOF Then
- 'Get all rows and 4 specific columns from query
- ar = RS_designerLetter.GetRows(, , Array("designer", "season", "collectionYear", "url"))
- If isarray(ar) Then
- CurrentDesigner = ar(0,0)
- sOutPut = "<p><strong>" & CurrentDesigner & "</strong><br>"
- ' Gets total number of rows in the array
- For i = 0 to ubound(ar,2)
- NextDesigner = ar(0,i)
- If CurrentDesigner < NextDesigner then
- CurrentDesigner = NextDesigner
- sOutPut = sOutPut & "<br><strong>" & CurrentDesigner & "</strong><br>"
- End if
- sOutPut = sOutPut & "<a href=""" & ar(3,i) & """>" & ar(1,i) & ar(2,i) & "</a> | "
- Next
- 'Using Len here only removes the divider on the last record of the last designer
- 'Need it to remove the last divider on the last record of each desginer
- sOutPut = Left(sOutPut,Len(sOutPut)-25)
- Response.Write(sOutPut)
- Response.Write("<br><br>End of Records Found</p>")
- Else
- Response.Write("<p>No Records Were Retrieved</p>")
- End if
- End if
- %>