条件表达式MS Access SQL查询中的数据类型不匹配

时间:2014-05-28 20:58:03

标签: sql ms-access

当我运行下面的查询时,我收到错误“数据类型不匹配n#39;

SELECT o.name as Name,
Month(CDate(type.Value)) as ValueType
FROM (t_obj as o
       INNER JOIN t_prop as type 
         ON o.Obj_ID = type.Obj_ID)
WHERE type.Property LIKE 'Tech*' 
  AND Month(type.Value) = 5

但是如果我按如下方式运行查询,它就可以正常运行

SELECT o.name as Name,
Month(CDate(type.Value)) as ValueType
FROM (t_obj as o
       INNER JOIN t_prop as type 
         ON o.Obj_ID = type.Obj_ID)
WHERE type.Property LIKE 'Tech*' 

1 个答案:

答案 0 :(得分:2)

AND Month(type.Value) = 5

AND Month(CDate(type.Value)) = 5