You need to sign in to do that
Don't have an account?

Unreachable statement , Unexpected token 'FROM',Expecting ';' but was: 'and'
global Database.QueryLocator start(Database.BatchableContext bc){
return Database.getQueryLocator(SELECT id,Email,name,MailingCountry,active__C,Flag__c,Chrun_Indicator__c,Sales_Program_Type__c FROM contact where AccountId!= null and account.Active__c='yes' and ( Account.Type like 'Customer%') and Active__c='Yes' and Email!= null and (NOT Email like '%cexz.com'));
}

return Database.getQueryLocator(SELECT id,Email,name,MailingCountry,active__C,Flag__c,Chrun_Indicator__c,Sales_Program_Type__c FROM contact where AccountId!= null and account.Active__c='yes' and ( Account.Type like 'Customer%') and Active__c='Yes' and Email!= null and (NOT Email like '%cexz.com'));
}
It seems to be a syntax error. Try below
When doing the SOQL queries with the QueryLocator in batch classes you need a [] around the usual ()
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
I have gone through your code. I traced the error that you have made. First, in Database.getQueryLocator we have to give any input as a string after that it converts that string into a query. So I have modified your code. please have a look.
global class batchclass {
global Database.QueryLocator start(Database.BatchableContext bc){
return Database.getQueryLocator('SELECT Id,Email,name,MailingCountry,active__C,Flag__c,Chrun_Indicator__c,Sales_Program_Type__c FROM Contact where AccountId!= null and Account.Active__c=\'Yes\' and ( Account.Type like \'Customer%\')and Active__c=\'Yes\' and Email!= null and (NOT Email like \'%cexz.com\')');
}
}
Hope this explanation will resolve your query. Mark it as the best answer if you find it helpful.
Thanks
Akshay