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
duc.lamduc.lam 

SOQL: if you specify a date format value, you can filter on date fields only

Hi,
 
I was using API 6.0 and am trying to upgrade to the current API 9.0.  With 6.0, I was able to filter on date and non-date fields as follows:
 
SELECT CaseNumber FROM Case WHERE isClosed = FALSE AND CreatedDate >= 2006-01-01
 
It seems that with API 9.0, this is no longer the case.   Specifically, the SOQL SELECT documentation states:
 
"A fieldExpression uses different date formats for date or dateTime fields. If you specify a dateTime format in a query, you can filter on dateTime fields only. Similarly, if you specify a date format value, you can filter on date fields only:"
 
I did try to submit the above query, but received an InvalidSObjectFault.
 
Does anyone know how I can rewrite the above to accomplish the same thing as before?
 
SuperfellSuperfell
SELECT CaseNumber FROM Case WHERE isClosed = FALSE AND CreatedDate >= 2006-01-01T00:00:00Z
duc.lamduc.lam
Thank-you!