What is the cleanest way to represent the following SQL in a SOQL query?
Where SubStr(MR_CONTRACTS.SPD_REF, 1, 2) In ('AM', 'TR', 'AH', 'AC', 'CT')
My SalesForce object name is also MR_Contracts The SalesForce field name is Contract_spd_ref__c
Tried the following with no success.
SELECT Name
FROM MR_Contracts__c
WHERE Contract_spd_ref__c LIKE 'AM%'
AND Contract_spd_ref__c LIKE 'TR%'
AND Contract_spd_ref__c LIKE 'AH%'
AND Contract_spd_ref__c LIKE 'AC%'
AND Contract_spd_ref__c LIKE 'CT%'
This returns the expected results. Still a longer query that I would like to shorten:
SELECT Name
FROM MR_Contracts__c
WHERE (Contract_spd_ref__c LIKE 'AM%'
OR Contract_spd_ref__c LIKE 'TR%'
OR Contract_spd_ref__c LIKE 'AH%'
OR Contract_spd_ref__c LIKE 'AC%'
OR Contract_spd_ref__c LIKE 'CT%')