日期:2014-05-17  浏览次数:21017 次

ASP显示的结果如何降序排列
请问下大家,从access数据库中得到结果如何在页面上降序显示,我用了order by itemname desc,好像不行,不知道问题出在哪里呢,谢谢!


RsItem.Open "SELECT VOTECOUNT FROM ITEM order by votecount desc WHERE TITLEID="&Rs("ID"),conn,1,1

Do While NOT RsItem.EOF
total = total + RsItem("VOTECOUNT")
RsItem.MoveNext
Loop


RsItem.Close


RsItem.Open "SELECT * FROM ITEM ORDER BY votecount desc WHERE TITLEID="&Rs("ID"),conn,1,1

If NOT (RsItem.EOF AND RsItem.BOF) Then
Do While NOT RsItem.EOF
%>
<tr>
<td class="tablebody1"> <%=RsItem("ITEM")%></td>
<td class="tablebody1" width="10%" nowrap><b><%=RsItem("VOTECOUNT")%></b>票</td>
<td class="tablebody1" width="80">
<%

------解决方案--------------------
你where怎么放到order by 后面去了


RsItem.Open "SELECT VOTECOUNT FROM ITEM WHERE TITLEID="&Rs("ID")&" order by votecount desc",conn,1,1



RsItem.Open "SELECT * FROM ITEM WHERE TITLEID="&Rs("ID")&" ORDER BY votecount desc",conn,1,1