+ Start a Discussion

Issue with Date Literals in Where Clause

Helo All,


I am trying to execete the following SOQL:


Select e.Activity_Weight__c, e.ActivityDate, e.DurationInMinutes, e.OwnerId, e.Owner.Id, e.Owner.Name, e.Type from Event e where ActivityDate = LAST_MONTH 


When I ran this Query today, I get the events from 2nd April to 1st May. Can anybody advice what is happening here? I ran the same query with ActivityDate=THIS_MONTH and I get all the events from 2nd May to 1st June.


So, looks like the date lilteral is resolving the values shifted by 1 day. 



Ramana maddikunta