Access query to get rows for a range of times (disregarding date)

最后都变了- 提交于 2019-12-25 04:44:46

问题


I have this table :

Number   Fall Time                     Accuracy 
-------------------------------------------------------
1        01/01/2010 10:00:00           0.3   
2        15/03/2011 10:30:00           0.123   
3        31/01/1994 11:00:00           0.2   

I want the fall time between 10:00:00 - 10:59:59 (Don't care about day/month/year)

I want this result :

      Accuracy 
-----------------
      0.3   
      0.123   

My try :

"SELECT Accuracy FROM Ikun WHERE PARSE(Fall_Time AS time) >= '10:00:00' AND PARSE(Fall_Time AS time) <= '10:59:59')"

The error : Missing operator syntax error in the query. Thanks in advance, Ben.


回答1:


Use HOUR function. Ref. this

SELECT Accuracy 
FROM Ikun 
WHERE HOUR(Fall_Time) = 10


来源:https://stackoverflow.com/questions/28542022/access-query-to-get-rows-for-a-range-of-times-disregarding-date

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!