You need to sign in to do that
Don't have an account?
VSK98
Dynamic Query not working
Hello All,
I was trying to retrieve the records with using the below dynamic soql query in batch class but getting the errors.
Snippet :
Regards,
VSK98
I was trying to retrieve the records with using the below dynamic soql query in batch class but getting the errors.
Snippet :
Datetime dt = Datetime.now(); Datetime dt1 = system.now().addMinutes(59).addSeconds(59); string SOQL = 'Select Id,status,ManagerId__c,Account,Account1__c,Account2__c,Account3__c, Reminder1__c' + ',Reminder2__c FROM Vehicle__C WHERE status = \" + String.escapeSingleQuotes('Submitted') + '\' AND Secondary_Status__c = \" + String.escapeSingleQuotes('Pending') + '\" + 'AND ((Reminder1__c >=' + dt+ 'AND Reminder1__c <= '+ dt1 +') OR (Reminder2__c >= '+ dt + 'AND Reminder2__c <=' + dt1 +'))';
Regards,
VSK98
Also what error are you seeing in your batch class?
I can able to retrieve the records in the developer console with straight soql query...reg error some where missing single quotes while framing the dynamic query