Query Dates Type Mismatch Error, Access

Previously in the article Query Dates, Access I’ve explained how you can run queries on date values. However if double quotes are used in the criterion section a type mismatch error will occur. In the figure below you can see a query in design mode:
Reason 1

This is the criterion used:

[table1].[DateField]>"1/1/2014"

In the article Query Dates, Access I’ve explained the different methods for defining dates in the criterion section of queries. Double quotes was not one of them. By using double quotes access will interpret the value between the quotes as a text string rather than a date value. This will result in a type mismatch error when comparing the text string value with the date values.
Result:
Type Mismatch

See also:

If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me. Also please visit my website www.software-solutions-online.com

Leave a Reply

Your email address will not be published. Required fields are marked *

privacy policy