You need to sign in to do that
Don't have an account?

How to write a SOQL Query which gets all the Activities in a particular month?
I had wriiten the query like this to get the events in a particular month like this,but this is producing error.
List<Event> activities=new List<Event>;
activities=[select ActivityDate from Event where ActivityDate.month()=5];
The error produced is :Error: Compile Error: unexpected token: ')'
Change your query as SELECT AccountId, ActivityDate FROM Event where CALENDAR_MONTH(ActivityDate) = 5.
Did this answer your question? if so, please mark it solved.