As you may know, using the REST API in SharePoint 2010 is a very flexible and powerful way to retrieve data from SharePoint. I love the way I can use the ListData.svc to get data form lists and document libraries. Finding the correct syntax however can sometimes be challenging…
Today, I found myself looking for a way of retrieving items from a calendar list. Getting the calendar items themselves wasn’t a problem, try to filter the items for only the current items (today and greater) was.
After some Googling and several syntax attempts I found out the right way to do it.
Say I only want to get calendar items that start on November 23, 2011 or beyond…
Works like a charm…
Update March 27, 2012
Because of the question Michal asked I retested some scenario’s. It turns out you cannot filter on time values. Real bummer 🙁
will filter on dates, greater or equal than 2011-11-23. It will not filter on 09:00, so an event taking place at i.e. 08:00 will be returned in the result set.
Therefore, there is no need to specify the time and you can filter without the time part of the query, like this:
If I’m wrong, please let me know…