Greetings fellow sharepoint warriors.
I am trying to understand the way all the filtering goes and I've stumbled upon a problem.
I would like to get items from list where birthday falls in current week. I am using Monday-Sunday if this is any help.
I have a column, which is Date & Time.
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api" + "/web/lists/getbytitle('Workers')/Items?$select=FirstName,Birthday,LastName", //THE ENDPOINT
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
//DO SOMETHING WITH DATA
}
});
I am trying to figure out how to filter date exactly. I know that filtering in range is done as following
$filter=(StartDate ge datetime'2014-01-01T00%3a00%3a00') and (EndDate le datetime'2014-04-30T00%3a00%3a00'
But how would i use a column information in that specific filter? If that was possible i could calculate day and month seperately and use jquery current year to filter between this weeks birthdays.
EDIT:/ Tried this out
_api/web/lists/getbytitle('Workers')/Items?$select=FirstName,Birthday,LastName&$filter=(Birthday ge datetime'1980-01-01T00%3a00%3a00') and (Birthday le datetime'2014-01-01T23%3a59%3a59') and (Day eq '21')
This gives me error: The field 'Day' of type 'Calculated' cannot be used in the query filter expression.
Best regards.