Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delimiters with LIKE

Status
Not open for further replies.

JRumage

MIS
Dec 16, 1998
7
US
Is there any way to use an apostrophe inside the like statement?&nbsp;&nbsp;For instance I want to find people with the last name that starts with <b>O'Co</b> as in O'Connell.<br><br>Are there other delimiters that can be used to make SQL ignore the apostrophe without using the _ wildcard?<br><br><br><br><br><br><br><br>
 
try this:<br>'O' + CHAR(ASCII code for ') + 'Connell'
 
Inclosing single quote in double quote should do the trick.<br><br>select &quot;O'Connnell&quot;<br><br>result is:<br>O'Connnell<br><br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top