数据库内数据相加问题!
代码如下<% Option Explicit %>
<!--#include file="config/conn.asp"-->
<%
on error resume next
dim rst,sql
set rst=server.createobject("adodb.recordset")
sql="select * from [xiaoshou] "
rst.open sql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body>
<table width="90%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolorlight="#9CA6C6" bordercolordark="#CCE3FF">
<tr bgcolor="#CCE3FF">
<td height="20" colspan="6" >销售总额 :</td>
</tr>
<tr bgcolor="#CCE3FF">
<td width="9%" height="20" align="center" class="word_yellow">商品编号</td>
<td width="9%" align="center" class="word_yellow">商品分类</td>
<td width="8%" align="center" class="word_yellow">商品名称</td>
<td width="8%" align="center" class="word_yellow">销售数量</td>
<td width="15%" align="center" class="word_yellow">销售金额</td>
<td width="36%" align="center" class="word_yellow">销售时间</td>
</tr>
<%
do while not rst.eof
%>
<tr bgcolor="#CCE3FF">
<td align="center"><%=rst("x_bid")%></td>
<td align="center"><%=rst("x_fname")%></td>
<td align="center"><%=rst("x_name")%></td>
<td align="center"><%=rst("x_num")%></td>
<td align="center"><%=rst("x_price")%></td>
<td align="center"><%=rst("x_time")%></td>
</tr>
<%
rst.movenext
loop
%>
</table>
<%
rst.close
set rst=nothing
conn.close
set conn=nothing
%>
</body>
</html>
我向把数据库里的销售总额统计出来,我用SUM后总是出现脚本超时,还请各位大侠帮帮忙!
[ 本帖最后由 fujian567 于 2010-7-29 22:55 编辑 ]