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
KrishSinghKrishSingh 

Query Error

Can any one help me to resolve this error "unexpected token: 'createdDate'". Coming when I am executing query.

 

Thank You

Krish

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

We can not compare like this:

 

To do so create a formula field (eg. name "MyCondition")

 

IF(lastModifiedDate > createdDate , 'true', 'false')

 Now in your query you can do like this :  

 

SELECT name, id FROM account WHERE MyCondition__c = 'true';

 Hope this will help.

 

 

Thanks
Ankit Arora

 

All Answers

Ankit AroraAnkit Arora

Please provide some more info or little bit of code snippet will work. Please provide your query atleast so we can understand where you are going wrong.

 

 

Thanks
Ankit Arora

 

KrishSinghKrishSingh

Thanks for the quick reply. My query is [SELECT name, id FROM account WHERE lastModifiedDate > createdDate] ;

Ankit AroraAnkit Arora

We can not compare like this:

 

To do so create a formula field (eg. name "MyCondition")

 

IF(lastModifiedDate > createdDate , 'true', 'false')

 Now in your query you can do like this :  

 

SELECT name, id FROM account WHERE MyCondition__c = 'true';

 Hope this will help.

 

 

Thanks
Ankit Arora

 

This was selected as the best answer
KrishSinghKrishSingh

Thank you. I got your point.