本帖最后由 用心去学 于 2019-8-22 23:47 编辑
<% for i=0 to 6
set rs002=server.CreateObject("adodb.recordset")
sql="select top 3 * from zb where xq like '%"&WeekDay(now)-1&"%' and tuijian=1 order by sx asc,sort_id asc,id desc"
rs002.open sql,conn,1,1
%>
<% next %>
<% End If %>
<% If nzcms1_id_9=1 Then %>
<%
if day(now)=1 or day(now)=2 or day(now)=3 or day(now)=4 or day(now)=5 or day(now)=6 or day(now)=7 or day(now)=8 or day(now)=9 then
set rs002=server.CreateObject("adodb.recordset")
sql="select top 3 * from zb where xq like '%0"&day(now)&"%' and tuijian=1 order by sx asc,sort_id asc,id desc"
rs002.open sql,conn,1,1
else
set rs002=server.CreateObject("adodb.recordset")
sql="select top 3 * from zb where xq like '%"&day(now)&"%' and tuijian=1 order by sx asc,sort_id asc,id desc"
rs002.open sql,conn,1,1
end if
%>
<% End If %>
<% if rs002.recordcount=0 then
response.Write("NO!")
%>
<% Else %>
<% do while not rs002.eof %>
<% set rs_zb=server.CreateObject("adodb.recordset")
rs_zb.open "select * from zb_sort where id="&rs002("sort_id")&" order by id",conn,1,1
%>
<tr>
<td align="center" valign="top">
<table width="95%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"
<tr>
<td width="75" height="25" align="center" valign="middle" bgcolor="#F5F5F5"><strong><%= rs_zb("sort") %></strong></td>
<td align="center" valign="middle">
// 下面的这个表格如果有两个数值的循环输出
<table width="90%" border="0" cellpadding="2" cellspacing="0">
<tr>
<td height="30" bgcolor="#FFFFFF" class="title12"><%= rs002("title") %>:<%= rs002("tel") %></td>
</tr>
</table>
//
</td>
</tr>
</table>
</td>
</tr>
<%
rs_zb.close
set rs_zb=nothing
rs002.movenext
loop
rs002.close
set rs002=nothing
%>
上面红色地方ASP语句该怎么写?ASP菜鸟,希望多学点,感谢! |