| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1618 人关注过本帖
标题:[求助]为什么按出生日期统计的各年龄段人数与比数据表中总人数少?
取消只看楼主 加入收藏
zln
Rank: 1
等 级:新手上路
帖 子:73
专家分:0
注 册:2006-1-6
收藏
 问题点数:0 回复次数:2 
[求助]为什么按出生日期统计的各年龄段人数与比数据表中总人数少?

dim wuwu,liushi,liuwu,qishi,qiwu,jiuwu,sqlstr,conn



%>
</head>
<body>
<div align="center">
<%
set rs_zongrenshu = server.CreateObject("adodb.recordset")
rs_zongrenshu.open "select * from tuixiu",conn,3,1
zongrenshu = rs_zongrenshu.RecordCount
set rs_wuwu=server.CreateObject("adodb.recordset")
sqlstr = "select * from tuixiu where UserBirth between'19520101' and '19570101'"
rs_wuwu.open sqlstr,conn,3,1
wuwu = rs_wuwu.RecordCount
set rs_liushi=server.CreateObject("adodb.recordset")
sqlstr = "select * from tuixiu where UserBirth between'19470101' and '19510101'"
rs_liushi.open sqlstr,conn,3,1
liushi = rs_liushi.RecordCount



set rs_liuwu=server.CreateObject("adodb.recordset")
sqlstr = "select * from tuixiu where UserBirth between'19420101' and '19460101'"
rs_liuwu.open sqlstr,conn,3,1
liuwu = rs_liuwu.RecordCount

set rs_qishi=server.CreateObject("adodb.recordset")
sqlstr = "select * from tuixiu where UserBirth between'19370101' and '19410101'"
rs_qishi.Open sqlstr,conn,3,1
qishi=rs_qishi.Recordcount



set rs_qiwu=server.CreateObject("adodb.recordset")
sqlstr = "select * from tuixiu where UserBirth between'19320101' and '19360101'"
rs_qiwu.open sqlstr,conn,3,1
qiwu = rs_qiwu.RecordCount

set rs_jiuwu=server.CreateObject("adodb.recordset")
sqlstr = "select * from tuixiu where UserBirth between'19110101' and '19310101'"
rs_jiuwu.open sqlstr,conn,3,1
jiuwu= rs_jiuwu.RecordCount

%>
<strong>按年龄统计</strong>
</p>
</div>
<p>&nbsp; </p>
</div>
<table width="618" border="1" align="center">
<tr>
<td width="228"><div align="center">50-55(岁)</div></td>
<td width="374"><div align="center">
<%response.Write(wuwu)%>
人</div></td>
</tr>
<tr>
<td><div align="center">56-60(岁)</div></td>
<td><div align="center">
<%response.Write(liushi)%>
人</div></td>
</tr>
</table>

搜索更多相关主题的帖子: 年龄段 总人数 数据 统计 
2007-09-30 12:42
zln
Rank: 1
等 级:新手上路
帖 子:73
专家分:0
注 册:2006-1-6
收藏
得分:0 
UserBirth是文本型,在数据表中以19690201这样的形式存放的
2007-09-30 13:12
zln
Rank: 1
等 级:新手上路
帖 子:73
专家分:0
注 册:2006-1-6
收藏
得分:0 
谢谢楼主,在您的指点下问题已解决!
2007-10-15 15:52
快速回复:[求助]为什么按出生日期统计的各年龄段人数与比数据表中总人数少?
数据加载中...
 
   



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

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