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
alibzafaralibzafar 

FeedItem query

I am trying to get a list of feedItems between the date enter by a user  

 

Here is my apex code

 

 

public dateTime startDate{get; set;}
public dateTime endDate{get; set;}

 

public void getFeeds(){

 

 List<FeedItem> fi = [Select Id from FeedItem where createdDate > startDate and createdDate < endDate)];

 

}

 


Getting Error: FeedController Compile Error: unexpected token: 'startDate'  

 

 

Thanks 

alibzafaralibzafar

Got the solution , 

 

List<FeedItem> fi = [Select Id from FeedItem where createdDate >=: startDate and createdDate <=: endDate)];

 

Thanks for having a look. 

 

Cheers