标题:高手进!!asp 以24小时制的每12个小时作为一个时间段,如何从数据库中选出 ...
取消只看楼主
yuchangyu
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2008-7-17
结帖率:88.89%
 问题点数:0 回复次数:1 
高手进!!asp 以24小时制的每12个小时作为一个时间段,如何从数据库中选出记录(access库)
比如白天的10:00以后到晚上22:00之间的数据和22:00以后到第二天10:00的数据分别作为2个时间段,我这样写的,可是2条语句都把半夜2:00作为记录结果
Set rsk = Server.CreateObject("ADODB.Recordset")
sql="select * from zsrbb Where sj='"&ssjj&"' and jh='"&rs0("jh")&"' and zrfs='"&rs0("zrfs")&"' and gcsj between #10:00# and #22:00# order by gcsj"
                  rsk.open sql,Conn,3,3

Set rskk = Server.CreateObject("ADODB.Recordset")
sql="select * from zsrbb Where sj='"&ssjj&"' and jh='"&rs0("jh")&"' and zrfs='"&rs0("zrfs")&"' and gcsj between #22:00# and #9:59# order by gcsj"
                  rskk.open sql,Conn,3,3
搜索更多相关主题的帖子: asp 时间段 access 数据库 
2010-05-16 23:07
yuchangyu
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2008-7-17
得分:0 
回复 楼主 yuchangyu
对啊,可是在10:00到22:00这个区间也搜出了这个结果啊
2010-05-17 09:49



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-306933-1-1.html




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

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