Microsoft Access - Class 3 - Part XIII
|
>
Back |
The Like Operator
The Like operator lets you create expressions with literals that
use the wildcard characters.
| * |
Represents any group characters |
| ? |
Represents any single characters |
| # |
Single Digit |
| [..] |
Character List |
| [!..] |
not in Character List |
For example, the expression [Last Name] Like "A*"
is evaluated as true for any record with a value in the Last Name
field that begins with A.
If you are interested in a text field where the second letter is
"a", the criteria would be:
Like "?a*".
If you were seeking values where the second letter could be an
"a" or "e", the criteria would be: Like "?[ae]*".
The opposite of this (all values that do not have "a"
or "e" as the second letter) is performed by adding an
"!": Like "?[!ae]*".
Finally, to select a range of letters (say "a" through
"e"), add a dash between the letters:
Like "?[a-e]*".
Print this page
|