SOQL by Length

Just learned a new SOQL query trick. When searching records where you want to omit values based on length one option is to use the following format:

SELECT Field1__c, Field2__c FROM Object__c Where Field1__c = ‘value’ AND (NOT Field2__c LIKE ‘____’)

Pretty handy!

Leave a Reply