For more information about SQL fuzzy queries, see the following:
1. Like 'mc % 'searches all strings starting with MC (for example, mcbadden ).
2. Like '% Inger' searches all strings ending with the letter Inger (such as ringer and Stringer ).
3. Like '% en %' searches for all strings (such as Bennet, green, and mcbadden) containing the letter en at any position ).
4. Like '_ heryl' searches for names (such as Cheryl and Sheryl) of all six letters ending with heryl ).
5. Like '[Ck] ARS [EO] n' will search for the following strings: Carsen, Karsen, Carson, and karson (such as Carson ).
6. Like '[M-Z] Inger' searches for all names (such as ringer) ending with string Inger, starting with any single letter from m to Z ).
7. Like'm [^ C] %' searches for all names starting with m, and the second letter is not C (such as macfeather ).
-------------------------------------------------
A complete example is required. The following query string is previously written. The zipcode_key variable is used to query the corresponding data in zipcode of the zip code table. The query statement is used to determine that the zipcode_key variable is not a number, use % to match strings of any length, query all data items containing keywords from the address, city, and province columns in the table, and sort by province, city, and address. This example is relatively simple. As long as you understand the method, you can write more complex query statements.
SQL = "select * From zipcode where (address like '%" & zipcode_key & "%') or (city like '%" & zipcode_key & "% ') or (province like '% "& zipcode_key &" %') order by province, city, address"
Note:
"%" Can contain multiple characters,
"_" Can only represent one character,
A Chinese character is two characters. Therefore, two _ characters are used to indicate Chinese characters, that is, "_".