求助:asp如何实现按年份分页
求助:asp如何实现按年份分页怎么样才能实现把记录按照年份分页
如下图效果:
" border="0" />
<% Set rs=conn.execute("select * from BigClass where Times like '%"&request("Page")&"%'") '按年份查询出来的内容 if not(rs.eof and rs.bof) then response.write "这里是查询显示该年份的所有内容" end if rs.close '注意字段时间格式为:2008-10-06 10:10:10 Set rs1=conn.execute("select top 1 Times from BigClass order by Times desc") '获取最早时间 Time1=split(split(rs("Times")," ")(0),"-")(0) rs1.close Set rs2=conn.execute("select top 1 Times from BigClass order by Times asc") '获取最后时间 Time2=split(split(rs("Times")," ")(0),"-")(0) rs2.close '下面从最早时间(Time1) 开始循环到 最后时间(Time2) for i=Time1 to Time2 if i=Time2 then response.write "<a href=""?Page="&i&""">"&i&"</a>" else response.write "<a href=""?Page="&i&""">"&i&"</a>|" end if next %>