I am using SQL Server 2008 R2. I am trying to create a recordset based off a sql statement. In the WHERE clause is 'INTERNATIONAL PEOPLE' + Char(39) + 'S'. So the single quote makes it PEOPLE'S. This is failing. From research it seems this should not fail. Any help would be great. Thanks
You can escape single quote by single quote :)
WHERE field = 'INTERNATIONAL PEOPLE''S'
From your sample in a comment, I'm guessing it's because your table is named 1099 and the error is not really from your WHERE clause. T-SQL expects table names to start with an alpha character.
Try putting brackets around that:
SELECT * FROM [1099] WHERE Name ='INTERNATIONAL PEOPLE' + CHAR(39) + 'S'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With