简体   繁体   English

SQL Access 2010按日期查询“条件表达式中的数据类型不匹配”。

[英]SQL Access 2010 querying by date “Data type mismatch in criteria expression.”

I'm trying to make a query in Access 2010, but it keeps giving me this error "Data type mismatch in criteria expression." 我正在尝试在Access 2010中进行查询,但它一直给我这个错误“条件表达式中的数据类型不匹配”。

The query is simple as 查询很简单

SELECT *
FROM mytable
WHERE date = '23-07-2013'

Any wonder why? 不知道为什么?

SELECT *
FROM mytable
WHERE date = #7/23/2013#

Access enclosed a date with # signs to indicate a literal value of date. Access用#符号括起日期以指示日期的文字值。 And using a single quote in your case means you are comparing a String/Text with a Date data type thus the Data Type mismatch. 在您的情况下使用单引号意味着您正在比较字符串/文本与日期数据类型,因此数据类型不匹配。 It should therefore be: 因此应该是:

 SELECT *
 FROM mytable
 WHERE date = #23/07/2013#

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “条件表达式中的数据类型不匹配。” ACCESS 2010和C# - “Data type mismatch in criteria expression.” ACCESS 2010 and C# 条件表达式中的数据类型不匹配。 - Data type mismatch in criteria expression. 数据类型不匹配条件表达式中访问2010 SQL INSERT语句 - Data Type Mismatch in criteria expression Access 2010 with SQL Insert Statement 日期-Access中条件表达式中的数据类型不匹配 - Date - Data type mismatch in criteria expression in Access System.Data.OleDB “条件表达式中的数据类型不匹配。” - System.Data.OleDB 'Data type mismatch in criteria expression.' ms access中出现“条件表达式中的数据类型不匹配。” ms错误,我做了所有建议的故障排除 - “Data type mismatch in criteria expression.” error in ms access, i did all the troubleshooting suggested 在MS Access Insert.Into期间解决“条件表达式中的数据类型不匹配。” - Troubleshooting “Data type mismatch in criteria expression.” during MS Access Insert.Into 条件表达式中的数据类型不匹配。 怎么了? - Data type mismatch in criteria expression. whats wrong? 在Access 2010中执行SQL子查询时,“条件表达式中的数据类型不匹配” - “Data type mismatch in criteria expression” when doing SQL subquery in Access 2010 比较Access中的日期值-条件表达式中的数据类型不匹配 - Comparing Date Values in Access - Data Type Mismatch in Criteria Expression
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM