VB and VBA Users Source Code: Using the Like comparison with Escaped characters
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Using the Like comparison with Escaped characters
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Thursday, November 20, 2003
Hits:
1060
Category:
Database/SQL/ADO
Article:
Occasionally, you may need to perform a like comparison on a reserved character (eg "[" or "%"). To do this you must specify and "Escape" character. This means that everytime you use this character, the following character will not be converted as a regular expression. See below for an example. --This bizarre example is searching for the first 100 people who name starts with "Andrew %Bake" select top 100 * from UserLogins where UserName like "Andrew ^%Bake%" ESCAPE "^"
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder