急求一段ASP代码

[复制链接]
查看11 | 回复2 | 2007-8-28 12:46:34 | 显示全部楼层 |阅读模式
select * from 表 where 时间>=a and 时间=a and 时间<=dateadd(hour,n,a)datediff(hour,a,b)/c则是几个N定义变量,加上WHEN语句判断就可以了
回复

使用道具 举报

千问 | 2007-8-28 12:46:34 | 显示全部楼层
select * from 表名 where 时间 between toDate("开始时间字符串","yyyy-mm-dd hh:mm:nn") to toDate("结束时间字符串","yyyy-mm-dd hh:mm:nn");
回复

使用道具 举报

千问 | 2007-8-28 12:46:34 | 显示全部楼层
你的表中数据假设两字段 date1 time1,表名"biao",数据库连接conndate1time1'代码开始dim a(100)dim b(100)dim ii=1rs.open "select * from biao ",conn,1,1do while not rs.eof tt=datediff("h",a1,rs("time1"))i=tt/Na(i)=a(i)+rs("date1") '将不同时间段的数据分别相加到数组A中b(i)=b(i)+1'保存某时间段下有多少数据相加过i=i+1loop for k=1 to ubound(a) response.write("结果如下
") response.write(a(k)*1.0/b(k)&"
) 'a(k)*0.1/b(k)先转换为浮点型数据,再除求平均数next具体代码仿照这些代码实现,因为我又不知道你表中数据什么情况,是什么系统
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行