简体   繁体   中英

Data type mismatch in criteria expression MS Access SQL query

When i run the query the below, i get the error `Data type mismatch'

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

However if i run the query as follows, it works just fine

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM