Article ID: 199163 - Last Review: June 29, 2004 - Revision: 2.0 ACC2000: Using LIKE with Wildcards May Cause Unexpected ResultsThis article was previously published under Q199163 Moderate: Requires basic macro, coding, and interoperability skills.
On This PageSYMPTOMS
In a Microsoft Access query, if you use the LIKE operator with a wildcard to search for dates, you may see unexpected results.
CAUSE
The Like function is used to compare two strings. It does not inspect the string for any type of date information.
RESOLUTION
Use the comparison operators <, >, <=, =>, <> or the BETWEEN clause when searching for dates. For example, when looking for dates in the month of May 97, use the following syntax:
Orders.OrderDate >= 5/1/1997 and Orders.OrderDate <=5/31/1997
MORE INFORMATIONSteps to Reproduce Behavior
| Article Translations
|
Back to the top
