Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to use a query like this one below
SELECT
Employee_Id, Work_Email, Department,City,Job_Title,Reports_To
FROM
Employee
WHERE
EmployeeName = 'Firstname O'Lastname'
I've tried combinations of using single and double quotes, using [] and also trying to use CHR(39) but nothing seems to get this to work properly....what do I do if the name has an embedded single quote?
You can escape the single quote with another single quote: EmployeeName = 'Firstname O''Lastname'
What brand of database is this query going to?
Its a SQL server database
You can escape the single quote with another single quote: EmployeeName = 'Firstname O''Lastname'
Thanks...that worked.
I had thought I had tried all the possible combinations.