The SQL primary command SLIKE, also known as the SLIKE operator, can be used for wildcard comparison against String values to filter specific data. The SLIKE operator has three special characters, each with a different usage: the percent sign (%), the underscore (_), and the caret (^).
Important: The "S" in SLIKE represents an abbreviated form of the word "sensitive"; therefore, the SLIKE operator is ALWAYS case-sensitive (even if the database tables are NOT case-sensitive).
% multi-character wildcard
The use of the percent sign (%) in a SLIKE clause retrieves matches of zero or more characters.
Example:
If the column TEST contains 'ABCDEF' the expression TEST SLIKE '%F' returns TRUE, the expression TEST SLIKE '%C%' returns
TRUE, and the expression TEST SLIKE '%G' returns FALSE.
Likewise, the expression TEST SLIKE 'f%' returns FALSE.
_ single-character wildcard
The use of an underscore (_) in a SLIKE clause retrieves matches of a single character.
Example:
If the column TEST contains 'GHIJKLM' the expression TEST SLIKE 'G_IJKLM' returns TRUE, and the expression TEST SLIKE 'A_IJKLM' returns FALSE.
Likewise, the expression TEST SLIKE 'A_ijkLM' returns FALSE.
^ literal character identifier
The use of the caret (^) in a SLIKE cause permits the use of any of the wildcard characters %, _ or ^. If the ^ character is placed in front of either of the other two wildcard characters, the characters following are treated as normal literals.
Example:
If the column TEST contains '10% of the data' the expression TEST SLIKE '10^% of the data' returns TRUE, the expression TEST SLIKE '10%data' returns TRUE, and the expression TEST SLIKE '10data' returns FALSE.
Important: The Microsoft Jet Engine for Microsoft Access uses an asterisk (*) as the wildcard character instead of the percent sign (%). Replace the percent sign (%) wildcard with an asterisk (*) when using Microsoft Access, or when using other DAO-compliant applications.