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
ecerboneecerbone 

Select where sObject.name starts with non-alpha value

Does anyone know fo a way to select from a sObject using SOQL where the name doesn't start with a letter from the US alphabet?  I tried using the NOT and Like keywords together, but the API doesn't like that.  I am using Enterprise WSDL in the .Net environment.
 
Thanks
SuperfellSuperfell
select name from account where not(name >= 'a' and name <= 'z')
ecerboneecerbone

Thank you for the quick reply, but that will still pull in accounts that start with z.  I changed the query to:

select name from account where not(name >= 'a' and name <= 'zÿ')

Thanks again.

ecerboneecerbone

It looks like I spoke to soon.  I am now getting MAILFORMED_QUERY errors when I run the query and there are additional conditions in the where cluase.

WHERE Interest_Type__c <> 'Web View' AND Interest__C.Fund__r.Name <>'' AND Publish2__c = 'Yes' AND not(Interest__C.Fund__r.Name  >= 'a' and Interest__C.Fund__r.Name  <= 'zÿ')