首先感谢楼上几位热心的朋友们,但是我还是不知道该怎么加在里面,所以还请大家再帮帮忙,,下面就是我的一部分源码,想要求出相同日期的“rijiaonailiang”的和,然后输出,我应该怎么做?麻烦大家了!!!
<%
byear=trim(request("nian"))
bmonth=trim(request("yue"))
bdate=trim(request("ri"))
if byear<>"" and bmonth<>"" and bdate<>"" then
riqi=byear&"-"&bmonth&"-"&bdate
end if
if byear<>"" and bmonth <>"" and bdate<>"" then
sql="select * from jnrtj123 where
nian='"&byear&"' and yue='"&bmonth&"' and ri='"&bdate&"' order by nian desc "
end if
if byear="" or bdate="" or bmonth="" then
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,2
if rs.eof then
response.write "<script language=JavaScript>{window.alert('没有相关记录,请按“确定”返回后“刷新”页面!');window.history.go(-1);}</script>"
response.end
end if
%>
<%count=0
totalcount=0
do while not rs.eof and count<rs.pagesize %>
<%if count Mod 2=0 then%><TR bgcolor="#E2EEFC" onMouseOver="this.style.backgroundColor='#FFDA6A'" onMouseOut="this.style.backgroundColor='#E2EEFC'">
<%end if%>
<td height="27" align="center" valign="middle" nowrap="nowrap"><%=count+1%></td>
<td align="center" valign="middle" nowrap="nowrap"><%=rs("xiangzhen")%></td>
<td align="center" valign="middle" nowrap="nowrap"><%=rs("rijiaonailiang")%></td>
<td align="center" valign="middle" nowrap="nowrap"><%=rs("riqi")%></td>
</tr>
<%totalcount=totalcount+rs.fields("rijiaonailiang")
rs.movenext
count=count+1
loop