| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 769 人关注过本帖
标题:请教!分页求和问题?
只看楼主 加入收藏
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
 问题点数:0 回复次数:12 
请教!分页求和问题?
用循环求和,分页后,只统计了最后一页的和值?
用select语句,则没有数值.整了好几天了.请哪位朋友指点一二!

附,语句如下:
………………
set rs=server.CreateObject("ADODB.RecordSet")
if Request("user_zhuozhe_name")="" and Request("user_dangwei_file")="" and Request("user_fashong_fangshi")="" then
rs.Source="select * from client where kfsj between #"&uptime&"# and #"&uptime1&"# order by id desc"
else
if Request("user_fashong_fangshi")="" then
if Request("user_dangwei_file")="" then
rs.Source="select * from client where zhuozhe_name like '%"&Request("user_zhuozhe_name")&"%' and (kfsj between #"&uptime&"# and #"&uptime1&"#) order by id desc"
else
rs.Source="select * from client where client_adr like '%"&Request("user_dangwei_file")&"%' and (kfsj between #"&uptime&"# and #"&uptime1&"#) order by id desc"
end if
else
rs.Source="select * from client where fashong_fangshi="&request("user_fashong_fangshi")&" and (kfsj between #"&uptime&"# and #"&uptime1&"#) order by id desc"
end if
end if
rs.Open rs.Source,conn,1,1
sql="select sum(freight) as from client" '//client是表名
if not rs.EOF then
rs.PageSize = MyPageSize
MaxPages = rs.PageCount
rs.absolutepage = Page
total = rs.RecordCount
………………
<td width="8%" height="18" align="right" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">&nbsp;<%=num%></td>
搜索更多相关主题的帖子: 求和 
2007-10-04 08:30
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 

哪位朋友帮忙看一下嘛!!!!!!!

2007-10-04 08:45
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
刚才粘贴的时候有误:

sql="select sum(freight) as num from client"

仍然没法出结果。
2007-10-04 08:48
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
2007-10-04 10:05
nuciewth
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:我爱龙龙
等 级:贵宾
威 望:104
帖 子:9786
专家分:208
注 册:2006-5-23
收藏
得分:0 
不懂,帮顶一下.

倚天照海花无数,流水高山心自知。
2007-10-04 10:09
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 

用select语句,则没有数值.整了好几天了.请哪位朋友指点一二!

附,语句如下:
………………
set rs=server.CreateObject("ADODB.RecordSet")
if Request("user_zhuozhe_name")="" and Request("user_dangwei_file")="" and Request("user_fashong_fangshi")="" then
rs.Source="select * from client where kfsj between #"&uptime&"# and #"&uptime1&"# order by id desc"
else
if Request("user_fashong_fangshi")="" then
if Request("user_dangwei_file")="" then
rs.Source="select * from client where zhuozhe_name like '%"&Request("user_zhuozhe_name")&"%' and (kfsj between #"&uptime&"# and #"&uptime1&"#) order by id desc"
else
rs.Source="select * from client where client_adr like '%"&Request("user_dangwei_file")&"%' and (kfsj between #"&uptime&"# and #"&uptime1&"#) order by id desc"
end if
else
rs.Source="select * from client where fashong_fangshi="&request("user_fashong_fangshi")&" and (kfsj between #"&uptime&"# and #"&uptime1&"#) order by id desc"
end if
end if
rs.Open rs.Source,conn,1,1
sql="select sum(freight) as from client" '//client是表名
if not rs.EOF then
rs.PageSize = MyPageSize
MaxPages = rs.PageCount
rs.absolutepage = Page
total = rs.RecordCount
……………… ’//这是分页显示、列表等,以下是最后一行加上总和的值
<td width="8%" height="18" align="right" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">&nbsp;<%=num%></td>

哪能位朋友抽点时间,帮忙看一下。

2007-10-04 10:34
笨得够呛
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2007-10-1
收藏
得分:0 
看不懂,也顶
2007-10-04 10:37
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
版主,帮忙看一下!!可不要让一个新手失望哟!!
2007-10-04 10:50
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
2007-10-05 11:41
coachard
Rank: 3Rank: 3
等 级:新手上路
威 望:7
帖 子:1251
专家分:0
注 册:2007-8-12
收藏
得分:0 
那么多SQL看了有点晕,不过有个问题,下面的SQL你在哪里执行了???
sql="select sum(freight) as from client"

怎么看不见执行语句???

偶学编程,也许本身就是一个错。。。
2007-10-05 11:46
快速回复:请教!分页求和问题?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018075 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved