Where to put single quatation marks in a query?

SQL 2014
I want to retrieve all the records that the value in Column A is the following phrase.
(SHIPPER'S LOAD AND COUNT.)
Note: The phrase includes parenthesis, apostrophe and period.)

Select * from Table A where Column A = '(SHIPPER'S LOAD AND COUNT.)'
This gave me an error.

Would you tell me how and where I need to put quotations? Thank you very much in advance.
kg6lfzAsked:
Who is Participating?
 
Dale FyeCommented:
Try:

SELECT * FROM [Table A] WHERE [Column A] = '(SHIPPER''S LOAD AND COUNT.)'

notice that i've replace the embedded single quote with two single quotes, side-by-side.  Access and SQL will both interpret this as a single embedded quote.

Are you doing this in Access, SQL Server, other?
1
 
Dean ChafeeIT/InfoSec ManagerCommented:
If your table and column name include space then you need to enclose in brackets, and I think also replace the single quote with [  ]
(not tested)


Select * from [Table A] where [Column A] = [(SHIPPER'S LOAD AND COUNT.)]
0
 
kg6lfzAuthor Commented:
SQL. Thank you for your help, Dale.
0
 
Dean ChafeeIT/InfoSec ManagerCommented:
Yup, what Dale said... double quote

SHIPPER''S

i missed that,   DOH
0
 
Dale FyeCommented:
glad to help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.