斑竹,你的那个我试了 不行哦 ,重新发贴

maocheng82 2014-08-18 10:41:21
数据利用do while not rs.eof ..rs,movenext loop 得到这个表
id cardtime
1 2014-05-01 08:00
1 2014-05-01 17:00
1 2014-05-01 22:00
2 2014-05-01 08:00
2 2014-05-01 18:00
现在想在中间加个判断,当下面一条ID等于前面一条ID,则变成如下表


id cardtime
1 2014-05-01 08:00 2014-05-01 17:00 2014-05-01 22:00
2 2014-05-01 08:00 2014-05-01 18:00
感觉要加个临时变量 ,请教各位了
...全文
224 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
csdn_aspnet 2014-08-20
  • 打赏
  • 举报
回复
再循环中记录一个ID值 进行比较 楼上写的很明白了
  • 打赏
  • 举报
回复
<table border="1">
<%
id=""
while not rs.eof
  if id<>rs("id") then
      if id<>"" then
       response.Write "</td></tr>"
      end if
     response.write "<tr><td>"&rs("id")&"</td><td>"
     id=rs("id")
  end if
  response.write " "&rs("cardtime")
  rs.movenext
wend

rs.close:set rs=nothing
cn.Close:set cn=nothing
%></td></tr></table>

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧