Calculate number of items between dates
Use case: I am wanting to count the number of client meetings that happened last month, are booked in the current month and are booked next month.  These items are all in a another app and have a field called demo date booked. So: I am looking for a way to use the calculations field to return a total number for the items in a related app that sit within the 'last calendar month', ' current calendar month' and 'next calendar month'.  These might well be best broken out into different calculation fields for ease of viewing! I'm aware that you can use moment js in calculations fields, but I'm not too familiar with it - so some help would be greatly appreciated!      

  • so something a bit like: Next month:  var date = @All of T : Demo Date & Timevar start = moment(date).endOf("month").toDate()var end = moment(date).add(1,"m").endOf("month").toDate() total = 0; for(var i = 0; i < date.length ; i++) {if (date[i] >= start && date[i] <= end) {total ++;}}total;   But, that works..
This question is closed.