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

Filtering with date in query

Hello Everyone,

Im facing problem with date.

i want to send records to batch apex filtered by createddate, but facing error as  "no viable Character".

as its from Class or Trigger, i can filter it by putting IF condition's in batch but that will be a long way.

so, Is there a way to do this: To filter the records in Query itself which we are sending to batch (String format)


Thanks & Regards


Best Answer chosen by Admin (Salesforce Developers) 
Imran MohammedImran Mohammed

I could not understand your question properly. But here is what i understood.

Looks like you are having Date in string which may be in improper format thats causing the issue.

Also make sure that you are using single quotes rather than double.