Wildcard characters in Access add flexibility to query criteria. Wildcard characters in Access represent unknown values. The asterisk “*” and the question mark “?” are the two main wildcard characters in Access you need to know. The asterisk represents multiple unknown characters. For example, the criteria “N*” would find all “N” words like “Nebraska,” “Ned,” “Not,” “Never Ever,” etc. The question mark represents one unknown character. So using a criteria like “N?D” would only find three letter “N…D” words like “Ned” and “Nod.” You can type as many question marks as needed to fill-in the required unknown characters. So, typing “N??D” finds words like “Need” and “Nerd,” for example. A picture showing how to use wildcard characters within query criteria in Access.When you type wildcard characters into the criteria row of the QBE grid, Access adds the word “Like” before them when you exit the criteria cell. This is simply the required syntax. It isn’t necessary for you to type it yourself, if you don’t want to, as Access adds it for you when it notices the wildcard characters being used. However, don’t worry if it appears in your wildcard criteria, either. To use wildcard characters in query criteria in Access, open the desired query in query design view. Then click into the “Criteria” row underneath the field into which to add the criteria. Type the criteria for which to search, using the appropriate wildcard characters. Finally, click the “Save” button in the Quick Access toolbar to save your changes. Instructions on How to Use Wildcard Characters in Access Queries
Video Lesson About Using Wildcard Characters in AccessThe following video lesson, titled “Using Wildcard Characters in Queries,” shows how to use wildcard characters in Access query criteria. This video is from our complete Access tutorial, titled “Mastering Access Made Easy v.2019 and 365.” To locate a specific item when you can't remember exactly how it is spelled, try using a wildcard character in a query. Wildcards are special characters that can stand in for unknown characters in a text value and are handy for locating multiple items with similar, but not identical data. Wildcards can also help with getting data based on a specified pattern match. For example, finding everyone named John on Park Street. For more information about queries, see introduction to queries. Here are some examples of wildcard characters for Access queries:
Learn more about applying criteria to a query. To use a wildcard character within a pattern:
Here are some examples of wildcard patterns that you can use in expressions:
To match special characters like question mark (?), number sign (#), and asterisk (*), put them in square brackets. The CHARLIST function gives you matches for one or more characters and can include almost any characters in the ANSI character set, including digits. The CHARLIST is enclosed in brackets ([ ]) and can be used with wildcard characters for more specific matches. To specify a range of characters, use CHARLIST with a hyphen (-) to separate the upper and lower bounds of the range. To match the hyphen (-) character, put it at the beginning or end of CHARLIST (after the exclamation mark if you’re using one). In any other location, the hyphen identifies a range of ANSI characters. |