PeanutsMonkey
PeanutsMonkey

Reputation: 7105

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*' 

Upvotes: 1

Views: 790

Answers (1)

FuzzyTree
FuzzyTree

Reputation: 32402

AND Month(type.Value) = 5

To

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

Upvotes: 2

Related Questions