asp查询求和问题
<%While((Repeat1__numRows<>0)AND(NOTRecordset1.EOF))%><tr><td><ahref="lookbyid.asp?id...
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td><a href="lookbyid.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>"><%=(Recordset1.Fields.Item("id").Value)%>查看</a> <a href="xiugai.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>">修改</a> <a href="dell.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>">删除</a></td>
<td><%=(Recordset1.Fields.Item("出车车号").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("驾驶员").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("出车日期").Value)%> </td>
<td><%=(Recordset1.Fields.Item("出车时间").Value)%> </td>
<td><%=(Recordset1.Fields.Item("返回日期").Value)%> </td>
<td><%=(Recordset1.Fields.Item("返回时间").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("用车人").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("出车地点").Value)%> <%=(Recordset1.Fields.Item("出车地点手工").Value)%></td>
<td><%=(Recordset1.Fields.Item("出车任务").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("本次里程").Value)%> </td>
<td><%
aa=(Recordset1.Fields.Item("是否录入返回信息").Value)
aa=Replace(aa,"否","<font color=red><B>未录入返回信息</b></font>")
response.write aa
%>
如上,查询后,如何将本次里程全部相加 展开
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td><a href="lookbyid.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>"><%=(Recordset1.Fields.Item("id").Value)%>查看</a> <a href="xiugai.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>">修改</a> <a href="dell.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>">删除</a></td>
<td><%=(Recordset1.Fields.Item("出车车号").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("驾驶员").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("出车日期").Value)%> </td>
<td><%=(Recordset1.Fields.Item("出车时间").Value)%> </td>
<td><%=(Recordset1.Fields.Item("返回日期").Value)%> </td>
<td><%=(Recordset1.Fields.Item("返回时间").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("用车人").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("出车地点").Value)%> <%=(Recordset1.Fields.Item("出车地点手工").Value)%></td>
<td><%=(Recordset1.Fields.Item("出车任务").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("本次里程").Value)%> </td>
<td><%
aa=(Recordset1.Fields.Item("是否录入返回信息").Value)
aa=Replace(aa,"否","<font color=red><B>未录入返回信息</b></font>")
response.write aa
%>
如上,查询后,如何将本次里程全部相加 展开
3个回答
展开全部
<%
li=0
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td><a href="lookbyid.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>"><%=(Recordset1.Fields.Item("id").Value)%>查看</a> <a href="xiugai.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>">修改</a> <a href="dell.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>">删除</a></td>
<td><%=(Recordset1.Fields.Item("出车车号").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("驾驶员").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("出车日期").Value)%> </td>
<td><%=(Recordset1.Fields.Item("出车时间").Value)%> </td>
<td><%=(Recordset1.Fields.Item("返回日期").Value)%> </td>
<td><%=(Recordset1.Fields.Item("返回时间").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("用车人").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("出车地点").Value)%> <%=(Recordset1.Fields.Item("出车地点手工").Value)%></td>
<td><%=(Recordset1.Fields.Item("出车任务").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("本次里程").Value)%> </td>
</tr>
<%
li=li+recordset1("本次里程")
recordset1.movenext
wend
%>
<%
response.write("总理程为"&li)
%>
li=0
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td><a href="lookbyid.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>"><%=(Recordset1.Fields.Item("id").Value)%>查看</a> <a href="xiugai.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>">修改</a> <a href="dell.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>">删除</a></td>
<td><%=(Recordset1.Fields.Item("出车车号").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("驾驶员").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("出车日期").Value)%> </td>
<td><%=(Recordset1.Fields.Item("出车时间").Value)%> </td>
<td><%=(Recordset1.Fields.Item("返回日期").Value)%> </td>
<td><%=(Recordset1.Fields.Item("返回时间").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("用车人").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("出车地点").Value)%> <%=(Recordset1.Fields.Item("出车地点手工").Value)%></td>
<td><%=(Recordset1.Fields.Item("出车任务").Value)%> </td>
<td> <%=(Recordset1.Fields.Item("本次里程").Value)%> </td>
</tr>
<%
li=li+recordset1("本次里程")
recordset1.movenext
wend
%>
<%
response.write("总理程为"&li)
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
TableDI
2024-07-18 广告
2024-07-18 广告
VLOOKUP函数在Excel中主要用于垂直查找数据,但无法直接一次性匹配多行数据。若要实现这一功能,可以采取以下方法:1. 使用辅助列和数组公式,通过IF函数结合TE电商平台TJOIN函数将多个匹配值合并到一个单元格中。2. 利用VLOO...
点击进入详情页
本回答由TableDI提供
展开全部
在<td> <%=(Recordset1.Fields.Item("本次里程").Value)%> </td> 后加入
<%
Totallc=Totallc+Recordset1.Fields.Item("本次里程").Value
%>
<%=Totallc%>
Totallc就是总里程
<%
Totallc=Totallc+Recordset1.Fields.Item("本次里程").Value
%>
<%=Totallc%>
Totallc就是总里程
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
先定义lc=0
然后在循环体内添加
lc=lc+本次里程值
最后输出lc
然后在循环体内添加
lc=lc+本次里程值
最后输出lc
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询