日期:2014-05-18  浏览次数:20964 次

Access2007数据库的日期查询方法是怎样的?
我用了一下代码:
Select * from tb_Weight where  
 Weight_DateTime >= #2012-07-03 13:11:43# and Weight_DateTime <= #2012-07-03 16:11:43#

或者:
Select * from tb_Weight where  
 Weight_DateTime between #2012-07-03 13:11:43# and #2012-07-03 16:11:43#

都报错啊,该如何写啊?Access2003与Access2007在时间查询代码上一致吗?谢谢!

------解决方案--------------------
Select * from tb_Weight where
 Weight_DateTime >= '2012-07-03 13:11:43' and Weight_DateTime <= '2012-07-03 16:11:43'

试试
------解决方案--------------------
access查询日期要加 # ,不过你的字段是日期型的吗,报什么错
------解决方案--------------------
数据库里面是2012-07-03 13:11:43这样的格式吗
------解决方案--------------------
http://blog.csdn.net/xianfajushi/article/details/4773217