You need to sign in to do that
Don't have an account?
Steve D
SOQL WHERE Date > NOW()-x
Hi All,
Im hoping someone can help me with an SOQL query:
I'm trying to return activities within the last 3 months. I.e where Activity Date >= NOW()-3 months
The SOQL documentation suggests you have to supply a native comparison value ie not a calculation.
Has anyone come across this before?
Thanks in advance,
Steve
Hi Steve,
You can use the phase as below in your query
WHERE Date = LAST_N_DAYS:90
All Answers
Hi Steve,
You can use the phase as below in your query
WHERE Date = LAST_N_DAYS:90
Message Edited by jrotenstein on 04-11-2008 11:17 AM
Are there other expressions that work such as Last_N_Hours? I want to check if some objects have been modified hourly.
Hi Barton,
Unfortunately this LAST_N_DAYS is not there in the SOQL , but that is not at all the end.
You can have a formula number field say Update_Hour and formula as (NOW() - LastModifiedDate) * 24)
and use the Clause like WHETE Update_Hour > 2
Thanks and Regards,
Dinesh Nasipuri
Dinesh.Nasipuri@gmail.com
thanks a lot for the advice!
Hi,
Sorry that was a Typo error , the LAST_N_DAYS is available with WHERE Clause , there are so such LAST_N_HOUR .
Thanks,
Dinesh Nasipuri