28,391
社区成员
发帖
与我相关
我的任务
分享
<%
sql="select * from name order by group"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align=center class=font>暂无值班人员</p>"
else
dim x,y,z
temp=0
x=1
do while not rs.eof
if temp<>rs("group") and temp>0 then
%>
<tr>
<td width="80" align="center"> </td>
<td width="130" align="center">第<%=x%>组:</td>
<td height="130" width="300"><%=y%></td>
<td width="500" align="center" bgcolor="#F7F7F7"><%=z%></td>
<td align="center"> </td>
</tr>
<%
x=x+1
end if
if temp<>rs("group") then
temp=rs("group")
if rs("lindao")=true then
y=rs("name")
else
z=rs("name")
end if
else
if rs("lindao")=true then
y=rs("name")+","+y
else
z=rs("name")+","+z
end if
end if
%>
<%
rs.MoveNext
loop
end if
set rs=nothing
%>
然后里面代码部分做下判断转换即可<%
sql="select * from name order by group"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align=center class=font>暂无值班人员</p>"
else
dim x,y,z
temp=0
do while not rs.eof
if temp<>rs("group") and temp>0 then
%>
<tr>
<td width="80" align="center"> </td>
<td width="130" align="center">第<%=x%>组:</td>
<td height="130" width="300"><%=y%></td>
<td width="500" align="center" bgcolor="#F7F7F7"><%=z%></td>
<td align="center"> </td>
</tr>
<%
x=x+1
end if
if temp<>rs("group") then
temp=rs("group")
if rs("lindao")=true then
y=rs("name")
else
z=rs("name")
end if
else
if rs("lindao")=true then
y=rs("name")+","+y
else
z=rs("name")+","+z
end if
end if
%>
<%
rs.MoveNext
loop
end if
set rs=nothing
%>
然后里面代码部分做下判断转换即可<%
dim x
for x=1 to 7
sql="select * from name order by group"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align=center class=font>暂无值班人员</p>"
else
dim y,z
do while not rs.eof
if cint(rs("group"))=x then
if rs("lindao")=true then
y=rs("name")+","+y
else
z=rs("name")+","+z
end if
end if
rs.MoveNext
loop
%>
<tr>
<td width="80" align="center"> </td>
<td width="130" align="center">第<%=x%>组:</td>
<td width="130"><%=y%></td>
<td width="500" align="center" bgcolor="#F7F7F7"><%=z%></td>
<td align="center"> </td>
</tr>
<%
y=""
z=""
End if
next
%>