求一sql语句,马上给分,在线等

MonkeyDHua 2004-07-13 02:27:37
查找Access数据库msg表时间日期字段str_time 在20:00:00至8:00:00中的所有记录 sql 语句该怎么写?
...全文
92 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluecobra 2004-07-13
  • 打赏
  • 举报
回复
看错了,应该是:
SELECT *
FROM Userinfo where (Hour(str_time)>20 and Hour(str_time)<24) or (Hour(str_time)>0 and Hour(str_time)<8)
试试看吧
bluecobra 2004-07-13
  • 打赏
  • 举报
回复
SELECT *
FROM Userinfo where Hour(str_time)>20 and Hour(str_time)>8
cwm545 2004-07-13
  • 打赏
  • 举报
回复
sql="select * from msg wheree str_time>=20:00:00 and str_time<=(24:00:00+8:00:00)"
以前做过一次,就是在第二天的时候加多24小时进行判断,感觉上好像是这样的,不过还要加个日期判断,不对之处还请笑谈。。。
MonkeyDHua 2004-07-13
  • 打赏
  • 举报
回复
不对,错误
古侠 2004-07-13
  • 打赏
  • 举报
回复
select * from [table] where str_time in (8:00:00,20:00:00) order by id desc

本人没有在ACCESS中调试,但是在SQL中应该是对的

28,408

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧