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
sfchesssfchess 

Does anyone know how to represent does not contain

In the reports query section, one of the values in the operator section for text fields is "does not contain". Is there a way to represent this in SOQL Syntax to call  from the API?

SuperfellSuperfell
select id, name from account where name not like '%foo%'
sfchesssfchess
Just tried to run "select id, name from account where name not like '%foo%'"
and get Query failed: MALFORMED_QUERY
Maybe it works in the api?

SuperfellSuperfell
That's what you get for writing soql without testing it this early in the morning, try this instead.

select id, name from account where not (name like '%foo%')
sfchesssfchess
Super !!
Thank you very much. One last question I know queries dont support joins. If I need to get all contacts and leads in campaign. Will the query have to look something like this
select .. from contact where (id = "xx" or id = "yy"  ...)

after that
select .. from lead where (id = "xx" or id = "yy"  ...)