Access数据库 查询日期范围?
select*fromtablewheredatetimebetween2013-01-01and2013-02-01select*fromtablewheredatet...
select * from table where datetime between 2013-01-01 and 2013-02-01
select * from table where datetime between '2013-01-01' and '2013-02-01'
select * from table where datetime between #2013-01-01# and #2013-02-01#
select * from table where datetime between '#2013-01-01#' and '#2013-02-01#'
select * from table where datetime >=2013-01-01 and datetime <=2013-02-01
select * from table where datetime >='2013-01-01' and datetime <='2013-02-01'
select * from table where datetime >=#2013-01-01# and datetime <=#2013-02-01#
select * from table where datetime >='#2013-01-01#' and datetime <='#2013-02-01#'
以上写法全部尝试过,都不可以!
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] 语法错误 在查询表达式 '_time >= #2013/03/01 00:00:00# and _time <=#2013/03/07 23:59:59#' 中。 展开
select * from table where datetime between '2013-01-01' and '2013-02-01'
select * from table where datetime between #2013-01-01# and #2013-02-01#
select * from table where datetime between '#2013-01-01#' and '#2013-02-01#'
select * from table where datetime >=2013-01-01 and datetime <=2013-02-01
select * from table where datetime >='2013-01-01' and datetime <='2013-02-01'
select * from table where datetime >=#2013-01-01# and datetime <=#2013-02-01#
select * from table where datetime >='#2013-01-01#' and datetime <='#2013-02-01#'
以上写法全部尝试过,都不可以!
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] 语法错误 在查询表达式 '_time >= #2013/03/01 00:00:00# and _time <=#2013/03/07 23:59:59#' 中。 展开
2个回答
推荐于2016-02-25
展开全部
字段名,先修改一下,改成别的、不和datetime冲突的。
或者加[]号
或者加[]号
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询