You need to sign in to do that
Don't have an account?
Ron-LON
SOQL "not like" query
Hi All,
Given a status field with values like "cancelled", "pending cancellation" , ... etc
I want to write this:
Subscription__c[] activeSubs = [select id from subscription__c where status__c not like '%cancel%'];
This doesn't work in real life and I'm sure Salesforce.com have some kind of reason for excluding such syntax from SOQL.
So does anyone have any suggestions for this other than rewriting my code every time a new status is added?
Thanks
have u tried this..
Subscription__c[] activeSubs = [select id from subscription__c where (Not status__c like 'cancel%'];
All Answers
have u tried this..
Subscription__c[] activeSubs = [select id from subscription__c where (Not status__c like 'cancel%'];
Subscription__c[] activeSubs = [select id from subscription__c where NOT (status__c like 'cancel' )];