asp时间比较

[复制链接]
查看11 | 回复1 | 2011-2-21 20:04:50 | 显示全部楼层 |阅读模式
asp时间比较:
1、6:00-10:00
2、10:01-2:00
3、2:01-7:00
数据库里有一个表的字段为datatime如:2011-2-20 9:30的记录
现在我需要在读数据库每一条记录datatime时间时根据上面的3个时间段做出不同的操作
比如在读datatime为2011-2-20 9:30时response.write "早上"
2011-2-20 11:30时response.write "中午"
2011-2-20 16:30时response.write "下午"
要怎么来做呀,兄弟帮我写一个例子,谢谢了,

回复

使用道具 举报

千问 | 2011-2-21 20:04:50 | 显示全部楼层
=6 and hour(rs("datatime"))10 and hour(rs("datatime"))
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行