I'm trying to query for records that do not contain LTD or LLP in the name and are also not assigned to a certain record type. I have tried just about every variation with parenthesis and AND/OR conditions but jo joy. Can anyone help? Fields removed for simplicity.
SELECT Full_Name__c, Account.Name FROM CONTACT
WHERE
NOT(account.name LIKE '%LTD%' OR account.name LIKE '%LLP%')
AND
(RecordType.Name != 'Broker' OR account.RecordType.Name != 'Broker')
ORDER BY account.name
Note that the below query does work:
SELECT Full_Name__c, Account.Name FROM CONTACT
WHERE
NOT(account.name LIKE '%LTD%' OR account.name LIKE '%LLP%')
ORDER BY account.name