ACC: Like vs. = with Wildcard Characters in Query SearchesLast reviewed: May 28, 1997Article ID: Q88166 |
The information in this article applies to:
SUMMARYNovice: Requires knowledge of the user interface on single-user computers. When you are searching a string by using wildcards (for example, * or ?), you must use Like or Not Like in the Criteria field, rather than using = or <>. When you use the = or <> operators, Microsoft Access treats them as actual characters to search for.
MORE INFORMATIONIf you have a table with one column called Col_Name and the following four records
Foos Foosball Foos ball Foos*and you create a query based on the table with the criteria
="Foos*"your query will return:
Foos*But, if your criteria is
Like "Foos*"your query will return the following four records:
Foos Foosball Foos ball Foos*The SQL statements built by Microsoft Access for these queries are as follows. The SQL statement using Like is:
SELECT DISTINCTROW tablename.Col_Name FROM [tablename] WHERE ((tablename.Col_Name Like "foos*"));The SQL statement using = is:
SELECT DISTINCTROW tablename.Col_Name FROM [tablename] WHERE ((tablename.Col_Name="foos*")); |
Keywords : kbusage QryOthr
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |