I have a snippet of code that writes the data alphabetically from a database ACROSS 3 columns on a web page.
Example:
a result b result c result d result e result f result g result h result i result
I need instead to display it alphabetically DOWN the columns, like this:
a result d result g result b result e result h result c result f result i result
Keeping in mind I have about 100 data results, it would display the first 1/3 in column one descending, then start a new column and continue, breaking it into 3 equal parts.
The code I have now that sorts across the rows is:
<%
GL="<table width="+Z+"100%"+Z+"border=0 cellpadding=3 celspacing=3>"
sql="select * from guideDef order by guideDesc;"
rs.open sql,adoCon
colCount=0
do while not rs.eof
colCount=(colCount+1) mod 3
if colCount=1 then GL=GL+"<tr>"
GL=GL+"<td valign=middle id=menu1 width="+Z+"33%"+Z+">"+E
GL=GL+"<a href="+Z+"shop.asp?guide="+rs("guide")+"&city=Plantation"+Z+">"+E
GL=GL+rs("guideDesc")+"</a></td>"
if colCount=0 then GL=GL+"</tr>"
GL=GL+E
rs.moveNext
loop
rs.close
if colCount=1 then GL=GL+"<td> </td><td> </td></tr>"+E
if colCount=2 then GL=GL+"<td> </td></tr>"+E
GL=GL+"</table>"
response.write GL
%>
Thanks in advance for any help. I don't write code, so I have tried for hours to change this without success.