function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mahendar mmahendar m 

Passing date literals as parameter.

Any can help this?
How to pass a date literals to method which queries based on date literals..like
public void yesterday(){
  getdata(YESTERDAY); 
}
public void getdata(date dateleteral){
      list<lead> l = [select id from lead where createddate = dateleteral];
}
Thanks...
William TranWilliam Tran
I don't think you can do that.  You can manually create a utility class (or search for one on the internet)  that does that for you.

For example , map YESTERDAY to Today() -1, etc.

thx.