1

Its possible to know how many items will end this current month? with REST GET URL $filter=

Test GET URL: /_api/lists/getbytitle('nameList')/items?$filter=Date_x0020_de_x0020_remise%272017-02%27

list : how many item this month ?

id |  Name | date
 1 |  Test |  24/02/2017 00:00 <<<<<=======
 2 |  Test |  24/01/2017 00:00
 3 |  Test |  24/04/2017 00:00

return 1

Thx

Nuno
  • 13
  • 1
  • 6
  • What REST endpoint have you tried from the documentation? http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#FilterSystemQueryOption – Danny '365CSI' Engelman Feb 14 '17 at 10:42
  • i found $filter=start_x0020_Date le date time'2016-03-26T09:59:32Z' its only before or after the date but never this month (all month) – Nuno Feb 14 '17 at 10:55
  • So what happens when you filter on dates higher then previous months last day and lower then next months first day ?? (or this months first & last day if you do it with the 'le' and 'ge' statements) – Danny '365CSI' Engelman Feb 14 '17 at 13:32
  • i found a solution thx ! (count each item on current month on "success" – Nuno Feb 15 '17 at 08:37

1 Answers1

0

Not sure if it can be done in REST, but you could also add a Calculated column to your list in Sharepoint with the calculation =MONTH([Created]) and use that instead.

Add another column for the year ( =YEAR([Created]) ) so you can sort and filter over the years

JJD
  • 493
  • 2
  • 5
  • 20
  • http://sharepoint.stackexchange.com/questions/105576/rest-api-filter-by-start-and-end-dates-using-today but its only betwen tow dates :s – Nuno Feb 14 '17 at 14:05