Is there a way to do a "Contains" Query in Salesforce/SOQL that picks up that word in a sentence, but not if it's part of a word?

Example: I want to find NATO accounts that say NATO ___ so I can't use equals, but things like "Donato's" are appearing as well.

1 Answer

Try including the space in your LIKE clause, i.e.

SELECT Id FROM Account WHERE Name LIKE 'NATO %' 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like