You need to sign in to do that
Don't have an account?
srinu namani 12
I have a lastSignificantInteraction__c field in my task object. I need to write a soql query which returns records with lastSignificantInteraction__c < CreatedDate. How can i write Query for this with this condition
Does this works?
List<Task> Lst = [select Id from Task where lastSignificantInteraction__c < CreatedDate];
List<Task> Lst = [select Id from Task where lastSignificantInteraction__c < CreatedDate];
Karanraj
Srinu - Salesforce doesn't allow direct field to field comparison in SOQL query.To achieve this you may create a formula field that will compare fields and return a value (like true or false) which you may use in a WHERE clause. Create a formula field of type Boolean in the Task object with the name eg.,DateCondtion with the below formula
Now your query will look like this and it will return the task record lastSignificantInteraction__c < CreatedDate
Waqar Hussain SF