"SimonF is correct. You cannot compare two fields, we can only compare a field with literal values. One work around is to use a formula field that has subtracted value the two dates, and then compare this to 0 in the query. ... ..."
"SimonF is correct. You cannot compare two fields, we can only compare a field with literal values. One work around is to use a formula field that has subtracted value the two dates, and then compare this to 0 in the query. ... ..."
Ok, from somebody else conversation I found:
"SimonF is correct. You cannot compare two fields, we can only compare a field with literal values. One work around is to use a formula field that has subtracted value the two dates, and then compare this to 0 in the query. ... ..."
So I can't compare those 2 formulas...
All Answers
Hi,
Please go through the following Link:
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_dateformats.htm
I hope this solves your problem.
No It doesn't, because I need to implement TODAY - Activation_Date__c where Activation_Date__c is a Date
you may change the condition to ,
Activated_Date__c < = Last_N_Days:5
Why 5?
I have the same problem with formula(number). I am trying to compare 2 of them:
Select Days_Since_Activated__c,Account.NotDealtDaysFrom_Ref__c, Account.Id
from Contact
where Account.NotDealtDaysFrom_Ref__c < Days_Since_Activated__c limit 10
Account.NotDealtDaysFrom_Ref__c is a Formula(number)
Days_Since_Activated__c is a Formula(Number)
but when I run the query it sais: Unexpected token: 'Days_Since_Activated__c'
Any ideas?
try this...m not sure though
Select Days_Since_Activated__c,Account.NotDealtDaysFrom_R ef__c, Account.Id
from Contact
where Account.NotDealtDaysFrom_Ref__c <: Days_Since_Activated__c limit 10
Days_Since_Activated__c isn't a variable but a field from the Object Contact, so no, it doesn't work.
the weird thing is that this other query works:
Select Days_Since_Activated__c,Account.NotDealtDaysFrom_R ef__c, Account.Id
from Contact
where Account.NotDealtDaysFrom_Ref__c < 5 limit 10
"5" is a number right? so if "Days_Since_Activated__c" is defined as number, why it is not working?
Ok, from somebody else conversation I found:
"SimonF is correct. You cannot compare two fields, we can only compare a field with literal values. One work around is to use a formula field that has subtracted value the two dates, and then compare this to 0 in the query. ... ..."
So I can't compare those 2 formulas...
gr8..thanks for sharing this...:)