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
Upton_XUpton_X 

No such column 'CreatedDated' on entity 'Case'.

I keep getting this error.  Why?

 

List<Case> userCreatedCases = [SELECT Id, CreatedById FROM Case WHERE CreatedDated = 2005-10-08T01:02:03Z];
Best Answer chosen by Upton_X
ShirishaShirisha (Salesforce Developers) 
Hi Upton,

Greetings!

I can see that the field name that you have used is "CreatedDated" which should be CreatedDate only.You have entered "D" which is why you are getting the error.

Please try the below SOQL query:
 
List<Case> userCreatedCases = [SELECT Id, CreatedById FROM Case WHERE CreatedDate = 2005-10-08T01:02:03Z];

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Regards,
Shirisha Pathuri

All Answers

ShirishaShirisha (Salesforce Developers) 
Hi Upton,

Greetings!

I can see that the field name that you have used is "CreatedDated" which should be CreatedDate only.You have entered "D" which is why you are getting the error.

Please try the below SOQL query:
 
List<Case> userCreatedCases = [SELECT Id, CreatedById FROM Case WHERE CreatedDate = 2005-10-08T01:02:03Z];

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Regards,
Shirisha Pathuri
This was selected as the best answer
Upton_XUpton_X
Perfect, thanks!