Query by example: the charlist wild card.

When using query by example there are the known wildcard characters “*” or “%”  and “?” or “_”; but, recently I stumbled upon a new wildcard known as the charlist.

Wildcard Description
* or % A substitute for zero or more characters
? or _ A substitute for exactly one character
[charlist] Any single character in charlist
[^charlist]or[!charlist] Any single character not in charlist

If you had a field “First Name” and entered the search value petrsl most likely that will return no results; however if you enter [petrsl] the search will return a result where the field starts with “p” or “e” or “t” or “r” or “s” or “l” by wrapping your search criteria with an open bracket [ and close bracket ].

*[^ ]-[^ ]*   This says, give me all the records with a ‘-‘ in the field, just so long as the character right before – and right after – isn’t a [space].

If you need to find records that start with a range of characters or numbers remember the charlist wildcard.