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

error in batch apex query.
return database.getquerylocator('select id,name__c,name__c,Project_Name__c from customerstatus__c where End_date__c =: Date.today().addDays(-2)');
i am using this in batch apex start method. i am getting error at this line at where condition. FATAL_ERROR System.QueryException: unexpected token: 'where'
i am using this in batch apex start method. i am getting error at this line at where condition. FATAL_ERROR System.QueryException: unexpected token: 'where'
Date dte = Date.today().addDays(-2);
return database.getquerylocator('select id,name__c,name__c,Project_Name__c from customerstatus__c where End_date__c =: dte ;
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm
Date dte = Date.today().addDays(-2);
String Name ='dell ';
String ActName ='Activity ';
return database.getquerylocator('select id,name__c,name__c,Project_Name__c from customerstatus__c where End_date__c staus__c !=\''+Name+'\' and type__c=\''+ActName+'\' where actual_End_date__c =: dte '
For basics of writing batch, you can go to this link
http://cloudyabhi.blogspot.in/2014/07/basics-of-apex-batch-class-in-salesforce.html