| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1863 人关注过本帖
标题:关于分页显示后的求和、小写转大写问题!!
取消只看楼主 加入收藏
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
 问题点数:0 回复次数:16 
关于分页显示后的求和、小写转大写问题!!

问题之一:和值永远为空,什么也没有。
问题之二:小写转大写永远是贰佰贰拾贰亿贰仟贰佰贰拾贰万贰仟贰佰贰拾贰元(也就是22222222222)

代码如下:
<TD height="25" align="center">列表标题</TD>
<td width="12%" height="25" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">内容</td>
……
<%
uptime=cstr(trim(request("uptime")))
uptime1=cstr(trim(request("uptime1")))
PageShowSize = 10 '每页显示多少个页
MyPageSize = 20 '每页显示多少条
If Not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Or Request("page") <=0 Then
Page=1
Else
Page=Int(Abs(Request("page")))
End if

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 like '%"&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

if not rs.EOF then
rs.PageSize = MyPageSize
MaxPages = rs.PageCount
rs.absolutepage = Page
total = rs.RecordCount
for i=1 to rs.PageSize
if not rs.EOF then
%>

<tr>
<td height="18" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><input name="selBigClass" type="checkbox" id="selBigClass" value="<%=rs("ID")%>"><a href="invoice_search03.Asp?id=<%=rs("ID")%>&action=edit"><%=rs("kfsj")%></a></td>
<td height="18" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">&nbsp;<%for j=1 to 3-len(rs("kfbm_person"))%>0<%next%><%=rs("kfbm_person")%></a></td>
<td height="18" align="left" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">&nbsp;<%=rs("zhuozhe_name")%></td>
<td height="18" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">&nbsp;<%=rs("client_adr")%></td>
<td height="18" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">&nbsp;<%=rs("client_file")%></td>
<td height="18" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">&nbsp;<%=rs("fashong_fangshi")%></td>
<td height="18" align="right" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">&nbsp;<%=rs("freight")%></td>
</TR>
<%
rs.MoveNext
end if
next
%>

<% if rs.eof Then
’//以下这一段是按上面的查询条件进行求和
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 sum(freight) as num 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 sum(freight) as num from client where zhuozhe_name like '%"&Request("user_zhuozhe_name")&"%' and (kfsj between #"&uptime&"# and #"&uptime1&"#) order by id desc"
else
rs.Source="select sum(freight) as num 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 sum(freight) as num from client where fashong_fangshi like '%"&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
’//以下是小写转大写
thenumber=num
call Money(22222222222)
function Money(thenumber)
dim n,String1,String2,length
dim one(),onestr()
String1="零壹贰叁肆伍陆柒捌玖"
String2="万仟佰拾亿仟佰拾万仟佰拾元"
length=len(thenumber)
redim one(length-1)
redim onestr(length-1)
for n=0 to length-1
one(n)=mid(thenumber,n+1,1)
one(n)=mid(string1,one(n)+1,1)
onestr(n)=mid(string2,14-length+n,1)
one(n)=one(n)&onestr(n)
next
Money=replace(join(one)," ","")
Money=replace(Money,"零元","元")
Money=replace(Money,"零万","万")
Money=replace(Money,"零亿","亿")
Money=replace(Money,"零仟","零")
Money=replace(Money,"零佰","零")
Money=replace(Money,"零拾","零")
do while not instr(Money,"零零")=0
Money=replace(Money,"零零","零")
loop
end function
%>
’//以下是显示合计值
<tr>
<td width="12%" height="22" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">&nbsp;&nbsp;&nbsp;&nbsp;合&nbsp;&nbsp;&nbsp;计</a></td>
<td width="7%" height="18" align="left" class="but" colspan="5" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">&nbsp;&nbsp;大&nbsp;写:&nbsp;<%=rs("Money")%></td>
<td width="8%" height="18" align="right" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">&nbsp;<%=num%></td>
<%end if %>
</tr>

<%end if%>
&nbsp;共 <%=total%> 条,当前第 <%=page%>/<%=Maxpages%>页,每页 <%=MyPageSize%> 条

……
以下是页码的显示(没问题)

搜索更多相关主题的帖子: quot 小写 uptime cstr className 
2007-10-05 12:53
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
2007-10-05 13:08
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
2007-10-05 13:25
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
终于等到你了
2007-10-05 14:34
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
最后一页,最后一行,
2007-10-05 14:35
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
几经思考,发现首先是NUM没得东西出来;然后就是CALL这里有问题。但就是不知道问题该怎么解决。
2007-10-05 14:38
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
2007-10-05 14:50
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 

我试一试,先谢谢了

2007-10-05 15:10
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
我看了,判断已经认定是最后一而,就是SQL语句有问题了!
谢谢。
我也正在看SQL到底哪点有问题!
2007-10-05 15:13
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
你说得很对!没想得细,就是想思路最简,结果写下来才发现操作难
2007-10-05 15:15
快速回复:关于分页显示后的求和、小写转大写问题!!
数据加载中...
 
   



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

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