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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search for names containing the ' char

Status
Not open for further replies.

Boorgy

Programmer
Jul 13, 2001
14
IE
Hi there SQL experts...

There's this problem I've been stuck on for a few hours:
I have a search query that checks for the name, like:
SELECT IDnumber FROM Employees WHERE Name='-----'

The problem is some of the names contain the ' char (O'Connor... who put an irish name in a database?)
Of course, Name='O'Connor' doesn't work...
Anybody got a bright idea?

Thanks

Nick
 
Use double quotes instead of single quotes around your string:

SELECT IDnumber FROM Employees WHERE Name="-----"

Then you don't have to worry about ' Joe Miller
joe.miller@flotech.net
 
use double quotes? {Chr(34) vs Chr(39)}?
MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top