You need to sign in to do that
Don't have an account?
Stuart Turnbull 9
SOQL - Searching for a % defined as a character in a string
Can anyone tell me how to search for a '%' inserted as text at the end of a Text string?
LIKE '%[%]'
This works fine in SQL. How would this work in SOQL?
LIKE '%[%]'
This works fine in SQL. How would this work in SOQL?
Use \%.
Read this documentation: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_quotedstringescapes.htm
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks,
Alex
All Answers
Use \%.
Read this documentation: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_quotedstringescapes.htm
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks,
Alex
The criteria is...
FROM Task
WHERE Description LIKE '\%'
I also tried:
AND Description LIKE '%\%'
I'm looking for anything in the Task.Description where % is used as a text character at the end of the string.
I wen to the documentation, but don't see what I'm overlooking.
Thanks.
Stuart
Thank you for your assistance.
Stuart
You cannot filter description in SOQL as it is a text area field. You can do the filtering in code like this: If there are any more condtions, you can add that in the SOQL where condition.
Thanks,
Shyama