asp中如何操作access数据库字段相加结合然后显示在网页上 表为 ID yintao juzi shucai apli 1 2 3 2 2 10
yintao加juzi加shucai加apli等于合计数合计价格显示在网页上这个代码该怎么写?表为IDyintaojuzishucaiapli12322...
yintao 加juzi 加shucai加 apli等于合计数
合计价格显示在网页上
这个代码该怎么写?
表为
ID yintao juzi shucai apli
1 2 3 2 2 展开
合计价格显示在网页上
这个代码该怎么写?
表为
ID yintao juzi shucai apli
1 2 3 2 2 展开
1个回答
展开全部
<%
Set MRs=server.CreateObject("adodb.recordset")
MRs.open"select ID,yintao,juzi,shucai,apli from [表名] order by ID asc",conn,3,1
if Not MRs.Eof then
Response.Write "<table border=""1""><tbody>"
Response.Write "<tr><td>ID</td><td>Yintao</td><td>Juzi</td><td>Shucai</td><td>apli</td><td>Count</td></tr>"
For I=1 To MRs.RecordCount
StrID=MRs("ID")
StrYintao=MRs("yintao")
StrJuzi=MRs("juzi")
StrShucai=MRs("shucai")
StrApli=MRs("apli")
StrCount=StrYintao+StrJuzi+StrShucai+StrApli
Response.Write "<tr><td>"&StrID&"</td><td>"&StrYintao&"</td><td>"&StrJuzi&"</td><td>"&StrShucai&"</td><td>"&StrApli&"</td><td>"&StrCount&"</td></tr>"
MRs.MoveNext
If MRs.Eof Then Exit For
Next
Response.Write "</tbody></table>"
end if
MRs.close
Set MRs=nothing
%>
Set MRs=server.CreateObject("adodb.recordset")
MRs.open"select ID,yintao,juzi,shucai,apli from [表名] order by ID asc",conn,3,1
if Not MRs.Eof then
Response.Write "<table border=""1""><tbody>"
Response.Write "<tr><td>ID</td><td>Yintao</td><td>Juzi</td><td>Shucai</td><td>apli</td><td>Count</td></tr>"
For I=1 To MRs.RecordCount
StrID=MRs("ID")
StrYintao=MRs("yintao")
StrJuzi=MRs("juzi")
StrShucai=MRs("shucai")
StrApli=MRs("apli")
StrCount=StrYintao+StrJuzi+StrShucai+StrApli
Response.Write "<tr><td>"&StrID&"</td><td>"&StrYintao&"</td><td>"&StrJuzi&"</td><td>"&StrShucai&"</td><td>"&StrApli&"</td><td>"&StrCount&"</td></tr>"
MRs.MoveNext
If MRs.Eof Then Exit For
Next
Response.Write "</tbody></table>"
end if
MRs.close
Set MRs=nothing
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询