function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LukeLuke 

Retrieving Account names with " ' "

Question, how can I retrieve an account name from sforce which has an apostrphe?  For example: select Name, numberOfEmployees, Id, Industry from Account where Name='O''Connor, Martha 19165829'

and It gives me malformed query error.  Normally in SQL server this would work.

Thanks,

Luke

HaroldHHaroldH
This question should go in the FAQ. Somewhere else in the forum, you'll find this question has been answered, but here's the quickie:

Try using \' for the apostrophe.

Example:

Select Id, LastName from Contact where LastName like 'O\'Connor'
LukeLuke
I did a search, and couldn't find it.  Thanks.