Using the Salesforce API, I am trying to search for Cases which have a CreatedDate between two specific dates, but I am getting errors when sending my query.
For example:
SELECT Id FROM Case
WHERE CreatedDate >= 2013-12-21 AND CreatedDate <= 2013-12-23
The error I get is:
value of filter criterion for field 'CreatedDate'
must be of type dateTime and should not be enclosed in quotes
I read the "Date Formats and Date Literals" article and do not see where the issue is in my query.
Best Answer
CreatedDate
is of DateTime type so your query must use the format from the very top of the article you've linked to:YYYY-MM-DDThh:mm:ssZ
(optionally with timezones)Another example: