Data type mismatch in criteria expression

philltee

New member
Local time
Today, 16:28
Joined
Nov 9, 2011
Messages
1
Hi all,

I have been trying to resolve an issue for 2 days now. I have tried to write a query which looks at the date each policy commences and based on that, I want to state what the next anniversary is. I have broken this down so that I have one column for the year (which is either this year or next year, depending on where the anniversary lands), then the month, then the day.

This all seems fine, but then as soon as I try to bring all 3 values together to make a date - I have tried CDate and DateSerial for this - then I am unable to filter this column. I just get the error message "Data type mismatch in criteria expression".

Anyone have any ideas what may be causing this issue??
 
Suggest you post your db and we can look at it and determine what is happening rather than guess.
 
My bet would be a data type mismatch in the criteria expression. :)

That means that you are trying to compare bricks with bottles. Without seeing exactly what you have done, ie. txt/sql of query, filter, or whatever it is, that's the best you can get.
 
While I am not sure why you needed to break the year into three separate Fields as opposed to one (because you did not explain), I can suggest a way for you to try to get back. Change all of the numeric values to strings, concatenate them together into a string that looks like your local date format (eg: DD/MM/YYYY), and use the FORMAT command to format that string as a date.

I think this might work for you.

-- Rookie
 

Users who are viewing this thread

Back
Top Bottom