Jan's Working with Databases:

Wild Card Characters


Home > Jan's CompLit 101 > Working with Databases > Appendix

Using Wild Card Characters

The Like operator that you use in a query's Criteria row compares values to a pattern that usually includes wild card characters.  These characters are placeholders, either for 1 character or for an unknown number of characters.

Use the character: Matches in an expression:
? or _ (underscore) Any single character
* or % Zero or more characters
# Any single digit (0 — 9)
[listofcharacters] Any single character in listofcharacters
[!listofcharacters] Any single character not in listofcharacters

Examples:

Like "A*" - values that start with the letter A

Like "A????" -values that start with A but have exactly 5 characters

Like "A[d,p]*" - values that start with Ad or Ap

Like "##QR#*" - values that start with 2 digits, then the letters QR, then another digit, followed by any number of other characters. For example, the registration code for a copy of Windows 95 that comes with a new computer has the form #####-OEM-########-#####, where OEM stands for Original Equipment Manufacturer.


Home > Jan's CompLit 101 > Working with Databases > Appendix

Last updated: September 17, 2012