ASP表格循环显示数值时,怎么显示对应另一个表中字段值?

数据库为sql2000,ba_paytype 表中有vccode字段值 等于 ba_account表中的vcpaytype字段值<td><%=list("vcpaytype")%></td> 这个地方怎么显示vcpaytype值等于ba_paytype表中vccode值对应的vcname值?<%dim bgtime,ovtimebgtime=request.Form("bgtime")ovtime=request.Form("ovtime")%><%set list=conn.execute("select * from ba_account where dttime>='"&bgtime&"' and dttime<='"&ovtime&"' order by [vcreckno]")%> <%set hmmoney=conn.execute("select sum(mmoney) from ba_account where dttime>='"&bgtime&"' and dttime<='"&ovtime&"' ")%> <table border=1 cellpadding="0" cellspacing="0" bordercolor="#CCCCCC"><tr><th nowrap="nowrap"><span class="STYLE3">付款方式</span></th><th nowrap="nowrap"><span class="STYLE3">单据号</span></th></tr><%do while not list.eof%><tr><td><%=list("vcpaytype")%></td> 这个地方想改成显示vcpaytype等于ba_paytype表中vccode对应的vcname,怎么改呢?<td><%=list("vcreckno")%></td></tr><%list.movenextloop%><tr><td colspan="8">合计:</td><td><strong><%=hmconsume("")%></strong></td><td><strong><%=hmagio("")%></strong></td></tr></table>谢谢啦,,非常感谢!!!!我分不多啊,总分15,全给了!!!!
2026-12-03 23:56:09
推荐回答(2个)
回答1:

可以哈萨克斯坦

的数据库在文本BB.ASP在,号码后
的Response.Write“(”文字或数字&“)”

回答2:

两个表对应的字段是什么?假设是classid。那么可以在循环里面再次查询一次表ba_paytype
set rs=conn.execute("select top 1 * from ba_paytype where classid="&list("classid")&" ")

也可以使用联合查询,速度会快点,这里不详细解答了