I have a batch class with a query string in which I want to limit the query to records last modified before a datetime, but the '<' char seems to need escaping and I can't find any documentation to tell me how. I have a dim and distant memory of using & lt; but that doesn't seem to work either.
Help!
eg global database.querylocator start(Database.BatchableContext BC) {
String todaysDate = string.valueof(date.today());
string query = 'Select Id, Name, StageName, CloseDate FROM Opportunity'
+ 'where LastModifiedDate < 2013-07-23T12:00:00.000Z';
return Database.getQueryLocator(query);
}
gives me a run time error on the '<' and if I use & lt; in its place.
System.debug(query)
), which will usually help outline the problem.