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
sfDevelopersfDeveloper 

Query

Hello,

Is it possible to excute this query call ??

SELECT name, id FROM account WHERE lastModifiedDate > createdDate;

U can see that I don't give a specified value for lastModifiedDate but I compair it with createdDate filed. If I excute this call, I get an error !!

sfDeveloper

 

Ankit AroraAnkit Arora

We can not compare like this:

 

To do so create a formula field (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