4 Replies Latest reply: Dec 9, 2015 4:13 AM by Kumar Pramod RSS

    Find Number of days

      Hi all,



      I have campaigns which starts on monday and ends on sunday.now i need the counts based on these campaigns and also month wise.

      for example:  for month wise counts : in October last week the campaign starts on 26/10/2015 and ends on 01/11/2015.

      Now for the October month count i need to exclude this campaigns data and include it to november month count.

      My actual concept is if campaign starts in the last month and ends in present month, then My month start or counts should be taken from that campaign start date of the last month, and the month end or counts till the last sunday of the current month.

      Example: 1)  October month count: from sep 28th  to   Oct 25th.

                     2)  November month count : from oct 26th  to Nov 29th.

      I achieved this by using script:

      date(weekend(CanonicalDate),'MMM-YY') as MonthPeriod

      MonthPeriod will give the require counts as above dates.

      1. now i need to calculate the Number of days in MonthPeriod. How can i do this?

      Ex: Number of days in Nov : 35

      2. Also, If i will be in the middle of the MonthPeriod, then the number of days passed from start of month period to till that date.

      Ex: if i will be on Nov 15 th then number of days passed should be 21.

      How can i achieve this?