如何在访问的2个日期和时间之间进行搜索? [英] how to search between 2 dates and times in access?
本文介绍了如何在访问的2个日期和时间之间进行搜索?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的访问字段为MyDate
和myTime
.
MyDate格式:16/09/2010 00:00:00
MyDate in format: 16/09/2010 00:00:00
MyTime格式:16/09/2010 04:27:00
MyTime in format: 16/09/2010 04:27:00
我需要在date 01/01/2010 and time 12:50:00 - and - date 12/11/2010 time 01:34:00
我需要写哪个查询?
先谢谢
推荐答案
Access中的分隔符是哈希(#).我希望您使用的是日期时间字段,而不是两个单独的字段(列).
The delimiter in Access is hash (#). I hope that you are using a date-time fields, and not two separate fields (columns).
SELECT MyDate
FROM tbl
WHERE MyDate Between #2/5/2006 14:7:0# And #11/18/2006 17:28:15#
您将在此处找到有关日期格式(ANSI,美国)和连接日期&的其他注释.时间:
You will find additional notes here on date formats (ANSI, US) and concatenating date & time:
在MS Access中插入记录时出错 MS Access 2007:日期查询
这篇关于如何在访问的2个日期和时间之间进行搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文