+ 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