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

求一个sql
数据库access,结构如下(表名:article)
id         content       sdate
1           aaa               2007-3-1
2           bbb               2007-2-28
3           ccc               2007-3-1
4           ddd               2007-2-28


<select   name= "rq "   size= "1 "   >
                    <%
set   rs1=server.createobject( "adodb.recordset ")
rs1.Open   "select   *   from   article   order   by   id   desc ",conn,1,1

do   while   not   rs1.eof
dtdate=rs1( "sdate ")
%>
                            <option   value= " <%=dtdate%> "> <%=dtdate%> </option>     option中怎样实现2007-2-28、2007-3-1各只有一条
                            <%
rs1.movenext
loop
%>
                </select>


------解决方案--------------------
多写下个查询

-------------------------------------

'下拉列表选择[ 时间 ]
dim rs4,sql4
set rs4=server.CreateObject( "adodb.recordset ")
sql4= "select Distinct sdate from [article] order by sdate desc "
rs4.open sql4,conn,1,1