You need to sign in to do that
Don't have an account?
Nong
SOQL : Compare DateTime field with current date time
Dear All,
I have the problem on SOQL to select past Event from below command but it does not compare the time , i tried system.now() but it did not work.
Could you please advise .
Select ActivityDateTime From Event where whatid=:tsk.whatid and
what.type = 'Account' and ActivityDateTime <> null and ActivityDateTime >=LAST_N_DAYS:0
Thank you very much in advance for your help.
Best Regards
Anong
Try changing your code as below :
Event e=[Select ActivityDateTime From Event where whatid=:tsk.whatid and what.type = 'Account' and ActivityDateTime <> null and ActivityDateTime <=:system.now()];
All Answers
Try changing your code as below :
Event e=[Select ActivityDateTime From Event where whatid=:tsk.whatid and what.type = 'Account' and ActivityDateTime <> null and ActivityDateTime <=:system.now()];
Dear Pradeep,
Thank you so much for your help , it works , i found my mistake is i used 'ActivityDateTime<=system.now()' not including ':' before system.now().
Could you please advise the link of the SOQL knowledgebase that i can learn in the future as i am the beginer on this.
Best Regards
Anong
Please gothrough the Below links for SOQL ,
http://www.sfdc99.com/2013/06/07/example-how-to-write-a-simple-soql-query/
http://www.salesforcegeneral.com/introduction-to-soql/
Please let me know if you need any information.