<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How could we  get the months between  the start date and end date</title><link>https://community.appian.com/discussions/f/rules/10876/how-could-we-get-the-months-between-the-start-date-and-end-date</link><description>Hi All, Currently I am working on a requirement where we need to compute the months based on start date and end date. Let me say for example start date 03/11/2016 and end date is 03/12/2017. The months between the dates should be &amp;quot; Dec-16&amp;quot;, &amp;quot;Jan-17&amp;quot;,</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47834?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2017 02:50:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e516a183-4826-4c6a-9012-c70a33b897e9</guid><dc:creator>vinod alla</dc:creator><description>Thank you Suresh and Ramesh&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47821?ContentTypeID=1</link><pubDate>Tue, 22 Aug 2017 16:07:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c5321093-789c-4a83-9e32-c8d53d524247</guid><dc:creator>sureshg57</dc:creator><description>&lt;p&gt;Hi Vinod,&lt;/p&gt;
&lt;p&gt;You can use below code to achieve the functionality you are after. If you want to use it to a project please add validation to it as I have not done any.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!monthNUmber:{1,2,3,4,5,6,7,8,9,10,11,12},
  local!monthName:{&amp;quot;Jan&amp;quot;,&amp;quot;Feb&amp;quot;,&amp;quot;Mar&amp;quot;,&amp;quot;Apr&amp;quot;,&amp;quot;May&amp;quot;,&amp;quot;Jun&amp;quot;,&amp;quot;Jul&amp;quot;,&amp;quot;Aug&amp;quot;,&amp;quot;Sep&amp;quot;,&amp;quot;Oct&amp;quot;,&amp;quot;Nov&amp;quot;,&amp;quot;Dec&amp;quot;},
with(
   local!years:year(ri!todate)-year(ri!fromDate),
   local!months:(local!years)*12 + month(ri!todate)-month(ri!fromdate)+1, /*Derive number of months in between two dates */
   local!enumArray: rdrop(1 + enumerate(local!months),1),  /*derive the array to iretare through*/
   local!thisYear: year(ri!fromdate),
   local!thisMonth: month(ri!fromdate),
   local!thisMonthYear: fn!displayvalue(local!thisMonth,{local!monthNUmber},{local!monthName},&amp;quot;&amp;quot;) &amp;amp; &amp;quot;-&amp;quot; &amp;amp;right(local!thisYear,2), /*Get first month year */

   append({local!thisMonthYear},
       apply(rule!TEST_appendYearMonth,local!enumArray,local!monthNUmber,local!monthName,ri!fromdate)      
    ) /*generate list of month year*/
 )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;rule called in apply has below structure and code in it. Just fiddle around if need to change the order how the Month-year should appear &lt;br /&gt;rule!TEST_appendYearMonth(int arrayInstance,int array monthNumList, text array monthNameList, date fromDate)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;fn!displayvalue(month(usereomonth(ri!fromDate,ri!arrayInstance)),ri!monthNumList,ri!monthNameList,&amp;quot;&amp;quot;) 
       &amp;amp;&amp;quot;-&amp;quot;&amp;amp;
right(year(usereomonth(ri!fromDate,ri!arrayInstance)),2)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Suresh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47675?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 03:37:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:87923593-c33b-4e3f-8fd0-4972a41421af</guid><dc:creator>Ram</dc:creator><description>Hi Vinod,&lt;br /&gt;
&lt;br /&gt;
As per your requirement I have modified the code and pasted below.&lt;br /&gt;
&lt;br /&gt;
with(&lt;br /&gt;
  local!fromMonth: month(&lt;br /&gt;
    ri!fromDatetime&lt;br /&gt;
  ),&lt;br /&gt;
  local!toMonth: month(&lt;br /&gt;
    ri!toDatetime&lt;br /&gt;
  ),&lt;br /&gt;
  local!fromYear: year(&lt;br /&gt;
    ri!fromDatetime&lt;br /&gt;
  ),&lt;br /&gt;
  local!toYear: year(&lt;br /&gt;
    ri!toDatetime&lt;br /&gt;
  ),&lt;br /&gt;
  if(&lt;br /&gt;
    and(&lt;br /&gt;
      local!fromYear = local!toYear,&lt;br /&gt;
      local!fromMonth &amp;gt; local!toMonth&lt;br /&gt;
    ),&lt;br /&gt;
    &amp;quot;From date should be less than to date&amp;quot;,&lt;br /&gt;
    if(&lt;br /&gt;
      local!fromYear &amp;gt; local!toYear,&lt;br /&gt;
      &amp;quot;From date should be less than to date&amp;quot;,&lt;br /&gt;
      if(&lt;br /&gt;
        local!fromYear = local!toYear,&lt;br /&gt;
        fn!apply(&lt;br /&gt;
          append(&lt;br /&gt;
            _,&lt;br /&gt;
            &amp;quot;-&amp;quot; &amp;amp; right(&lt;br /&gt;
              local!fromYear,&lt;br /&gt;
              2&lt;br /&gt;
            )&lt;br /&gt;
          ),&lt;br /&gt;
          {&lt;br /&gt;
            difference(&lt;br /&gt;
              {&lt;br /&gt;
                fn!apply(&lt;br /&gt;
                  fn!displayvalue(&lt;br /&gt;
                    _,&lt;br /&gt;
                    {&lt;br /&gt;
                      1,&lt;br /&gt;
                      2,&lt;br /&gt;
                      3,&lt;br /&gt;
                      4,&lt;br /&gt;
                      5,&lt;br /&gt;
                      6,&lt;br /&gt;
                      7,&lt;br /&gt;
                      8,&lt;br /&gt;
                      9,&lt;br /&gt;
                      10,&lt;br /&gt;
                      11,&lt;br /&gt;
                      12&lt;br /&gt;
                    },&lt;br /&gt;
                    {&lt;br /&gt;
                      &amp;quot;Jan&amp;quot;,&lt;br /&gt;
                      &amp;quot;Feb&amp;quot;,&lt;br /&gt;
                      &amp;quot;Mar&amp;quot;,&lt;br /&gt;
                      &amp;quot;Apr&amp;quot;,&lt;br /&gt;
                      &amp;quot;May&amp;quot;,&lt;br /&gt;
                      &amp;quot;Jun&amp;quot;,&lt;br /&gt;
                      &amp;quot;Jul&amp;quot;,&lt;br /&gt;
                      &amp;quot;Aug&amp;quot;,&lt;br /&gt;
                      &amp;quot;Sep&amp;quot;,&lt;br /&gt;
                      &amp;quot;Oct&amp;quot;,&lt;br /&gt;
                      &amp;quot;Nov&amp;quot;,&lt;br /&gt;
                      &amp;quot;Dec&amp;quot;&lt;br /&gt;
                    },&lt;br /&gt;
                    null&lt;br /&gt;
                  ),&lt;br /&gt;
                  {&lt;br /&gt;
                    enumerate(&lt;br /&gt;
                      local!toMonth + 1 - local!fromMonth&lt;br /&gt;
                    ) + local!fromMonth&lt;br /&gt;
                  }&lt;br /&gt;
                )&lt;br /&gt;
              },&lt;br /&gt;
              {&lt;br /&gt;
                null&lt;br /&gt;
              }&lt;br /&gt;
            )&lt;br /&gt;
          }&lt;br /&gt;
        ),&lt;br /&gt;
        if(&lt;br /&gt;
          local!toYear - local!fromYear = 1,&lt;br /&gt;
          append(&lt;br /&gt;
            fn!apply(&lt;br /&gt;
              append(&lt;br /&gt;
                _,&lt;br /&gt;
                &amp;quot;-&amp;quot; &amp;amp; right(&lt;br /&gt;
                  local!fromYear,&lt;br /&gt;
                  2&lt;br /&gt;
                )&lt;br /&gt;
              ),&lt;br /&gt;
              {&lt;br /&gt;
                difference(&lt;br /&gt;
                  {&lt;br /&gt;
                    fn!apply(&lt;br /&gt;
                      fn!displayvalue(&lt;br /&gt;
                        _,&lt;br /&gt;
                        {&lt;br /&gt;
                          1,&lt;br /&gt;
                          2,&lt;br /&gt;
                          3,&lt;br /&gt;
                          4,&lt;br /&gt;
                          5,&lt;br /&gt;
                          6,&lt;br /&gt;
                          7,&lt;br /&gt;
                          8,&lt;br /&gt;
                          9,&lt;br /&gt;
                          10,&lt;br /&gt;
                          11,&lt;br /&gt;
                          12&lt;br /&gt;
                        },&lt;br /&gt;
                        {&lt;br /&gt;
                          &amp;quot;Jan&amp;quot;,&lt;br /&gt;
                          &amp;quot;Feb&amp;quot;,&lt;br /&gt;
                          &amp;quot;Mar&amp;quot;,&lt;br /&gt;
                          &amp;quot;Apr&amp;quot;,&lt;br /&gt;
                          &amp;quot;May&amp;quot;,&lt;br /&gt;
                          &amp;quot;Jun&amp;quot;,&lt;br /&gt;
                          &amp;quot;Jul&amp;quot;,&lt;br /&gt;
                          &amp;quot;Aug&amp;quot;,&lt;br /&gt;
                          &amp;quot;Sep&amp;quot;,&lt;br /&gt;
                          &amp;quot;Oct&amp;quot;,&lt;br /&gt;
                          &amp;quot;Nov&amp;quot;,&lt;br /&gt;
                          &amp;quot;Dec&amp;quot;&lt;br /&gt;
                        },&lt;br /&gt;
                        null&lt;br /&gt;
                      ),&lt;br /&gt;
                      {&lt;br /&gt;
                        enumerate(&lt;br /&gt;
                          12&lt;br /&gt;
                        ) + local!fromMonth&lt;br /&gt;
                      }&lt;br /&gt;
                    )&lt;br /&gt;
                  },&lt;br /&gt;
                  {&lt;br /&gt;
                    null&lt;br /&gt;
                  }&lt;br /&gt;
                )&lt;br /&gt;
              }&lt;br /&gt;
            ),&lt;br /&gt;
            fn!apply(&lt;br /&gt;
              append(&lt;br /&gt;
                _,&lt;br /&gt;
                &amp;quot;-&amp;quot; &amp;amp; right(&lt;br /&gt;
                  local!toYear,&lt;br /&gt;
                  2&lt;br /&gt;
                )&lt;br /&gt;
              ),&lt;br /&gt;
              {&lt;br /&gt;
                difference(&lt;br /&gt;
                  {&lt;br /&gt;
                    fn!apply(&lt;br /&gt;
                      fn!displayvalue(&lt;br /&gt;
                        _,&lt;br /&gt;
                        {&lt;br /&gt;
                          1,&lt;br /&gt;
                          2,&lt;br /&gt;
                          3,&lt;br /&gt;
                          4,&lt;br /&gt;
                          5,&lt;br /&gt;
                          6,&lt;br /&gt;
                          7,&lt;br /&gt;
                          8,&lt;br /&gt;
                          9,&lt;br /&gt;
                          10,&lt;br /&gt;
                          11,&lt;br /&gt;
                          12&lt;br /&gt;
                        },&lt;br /&gt;
                        {&lt;br /&gt;
                          &amp;quot;Jan&amp;quot;,&lt;br /&gt;
                          &amp;quot;Feb&amp;quot;,&lt;br /&gt;
                          &amp;quot;Mar&amp;quot;,&lt;br /&gt;
                          &amp;quot;Apr&amp;quot;,&lt;br /&gt;
                          &amp;quot;May&amp;quot;,&lt;br /&gt;
                          &amp;quot;Jun&amp;quot;,&lt;br /&gt;
                          &amp;quot;Jul&amp;quot;,&lt;br /&gt;
                          &amp;quot;Aug&amp;quot;,&lt;br /&gt;
                          &amp;quot;Sep&amp;quot;,&lt;br /&gt;
                          &amp;quot;Oct&amp;quot;,&lt;br /&gt;
                          &amp;quot;Nov&amp;quot;,&lt;br /&gt;
                          &amp;quot;Dec&amp;quot;&lt;br /&gt;
                        },&lt;br /&gt;
                        null&lt;br /&gt;
                      ),&lt;br /&gt;
                      {&lt;br /&gt;
                        enumerate(&lt;br /&gt;
                          local!toMonth&lt;br /&gt;
                        ) + 1&lt;br /&gt;
                      }&lt;br /&gt;
                    )&lt;br /&gt;
                  },&lt;br /&gt;
                  {&lt;br /&gt;
                    null&lt;br /&gt;
                  }&lt;br /&gt;
                )&lt;br /&gt;
              }&lt;br /&gt;
            )&lt;br /&gt;
          ),&lt;br /&gt;
          if(&lt;br /&gt;
            local!toYear - local!fromYear &amp;gt; 1,&lt;br /&gt;
            append(&lt;br /&gt;
              fn!apply(&lt;br /&gt;
                append(&lt;br /&gt;
                  _,&lt;br /&gt;
                  &amp;quot;-&amp;quot; &amp;amp; right(&lt;br /&gt;
                    local!fromYear,&lt;br /&gt;
                    2&lt;br /&gt;
                  )&lt;br /&gt;
                ),&lt;br /&gt;
                {&lt;br /&gt;
                  difference(&lt;br /&gt;
                    {&lt;br /&gt;
                      fn!apply(&lt;br /&gt;
                        fn!displayvalue(&lt;br /&gt;
                          _,&lt;br /&gt;
                          {&lt;br /&gt;
                            1,&lt;br /&gt;
                            2,&lt;br /&gt;
                            3,&lt;br /&gt;
                            4,&lt;br /&gt;
                            5,&lt;br /&gt;
                            6,&lt;br /&gt;
                            7,&lt;br /&gt;
                            8,&lt;br /&gt;
                            9,&lt;br /&gt;
                            10,&lt;br /&gt;
                            11,&lt;br /&gt;
                            12&lt;br /&gt;
                          },&lt;br /&gt;
                          {&lt;br /&gt;
                            &amp;quot;Jan&amp;quot;,&lt;br /&gt;
                            &amp;quot;Feb&amp;quot;,&lt;br /&gt;
                            &amp;quot;Mar&amp;quot;,&lt;br /&gt;
                            &amp;quot;Apr&amp;quot;,&lt;br /&gt;
                            &amp;quot;May&amp;quot;,&lt;br /&gt;
                            &amp;quot;Jun&amp;quot;,&lt;br /&gt;
                            &amp;quot;Jul&amp;quot;,&lt;br /&gt;
                            &amp;quot;Aug&amp;quot;,&lt;br /&gt;
                            &amp;quot;Sep&amp;quot;,&lt;br /&gt;
                            &amp;quot;Oct&amp;quot;,&lt;br /&gt;
                            &amp;quot;Nov&amp;quot;,&lt;br /&gt;
                            &amp;quot;Dec&amp;quot;&lt;br /&gt;
                          },&lt;br /&gt;
                          null&lt;br /&gt;
                        ),&lt;br /&gt;
                        {&lt;br /&gt;
                          enumerate(&lt;br /&gt;
                            12&lt;br /&gt;
                          ) + local!fromMonth&lt;br /&gt;
                        }&lt;br /&gt;
                      )&lt;br /&gt;
                    },&lt;br /&gt;
                    {&lt;br /&gt;
                      null&lt;br /&gt;
                    }&lt;br /&gt;
                  )&lt;br /&gt;
                }&lt;br /&gt;
              ),&lt;br /&gt;
              fn!apply(&lt;br /&gt;
                rule!getAllMonthsInAYear(&lt;br /&gt;
                  _&lt;br /&gt;
                ),&lt;br /&gt;
                enumerate(&lt;br /&gt;
                  (&lt;br /&gt;
                    local!toYear - local!fromYear&lt;br /&gt;
                  ) - 1&lt;br /&gt;
                ) + local!fromYear + 1&lt;br /&gt;
              ),&lt;br /&gt;
              fn!apply(&lt;br /&gt;
                append(&lt;br /&gt;
                  _,&lt;br /&gt;
                  &amp;quot;-&amp;quot; &amp;amp; right(&lt;br /&gt;
                    local!toYear,&lt;br /&gt;
                    2&lt;br /&gt;
                  )&lt;br /&gt;
                ),&lt;br /&gt;
                {&lt;br /&gt;
                  difference(&lt;br /&gt;
                    {&lt;br /&gt;
                      fn!apply(&lt;br /&gt;
                        fn!displayvalue(&lt;br /&gt;
                          _,&lt;br /&gt;
                          {&lt;br /&gt;
                            1,&lt;br /&gt;
                            2,&lt;br /&gt;
                            3,&lt;br /&gt;
                            4,&lt;br /&gt;
                            5,&lt;br /&gt;
                            6,&lt;br /&gt;
                            7,&lt;br /&gt;
                            8,&lt;br /&gt;
                            9,&lt;br /&gt;
                            10,&lt;br /&gt;
                            11,&lt;br /&gt;
                            12&lt;br /&gt;
                          },&lt;br /&gt;
                          {&lt;br /&gt;
                            &amp;quot;Jan&amp;quot;,&lt;br /&gt;
                            &amp;quot;Feb&amp;quot;,&lt;br /&gt;
                            &amp;quot;Mar&amp;quot;,&lt;br /&gt;
                            &amp;quot;Apr&amp;quot;,&lt;br /&gt;
                            &amp;quot;May&amp;quot;,&lt;br /&gt;
                            &amp;quot;Jun&amp;quot;,&lt;br /&gt;
                            &amp;quot;Jul&amp;quot;,&lt;br /&gt;
                            &amp;quot;Aug&amp;quot;,&lt;br /&gt;
                            &amp;quot;Sep&amp;quot;,&lt;br /&gt;
                            &amp;quot;Oct&amp;quot;,&lt;br /&gt;
                            &amp;quot;Nov&amp;quot;,&lt;br /&gt;
                            &amp;quot;Dec&amp;quot;&lt;br /&gt;
                          },&lt;br /&gt;
                          null&lt;br /&gt;
                        ),&lt;br /&gt;
                        {&lt;br /&gt;
                          enumerate(&lt;br /&gt;
                            local!toMonth&lt;br /&gt;
                          ) + 1&lt;br /&gt;
                        }&lt;br /&gt;
                      )&lt;br /&gt;
                    },&lt;br /&gt;
                    {&lt;br /&gt;
                      null&lt;br /&gt;
                    }&lt;br /&gt;
                  )&lt;br /&gt;
                }&lt;br /&gt;
              )&lt;br /&gt;
            ),&lt;br /&gt;
            null&lt;br /&gt;
          )&lt;br /&gt;
        )&lt;br /&gt;
      )&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
I haven&amp;#39;t applied any date range to the code which might cause performance issue if the difference between two years is huge.&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
&lt;br /&gt;
code used in rule!getAllMonthsInAYear() is&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Jan&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2),&lt;br /&gt;
  &amp;quot;Feb&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2),&lt;br /&gt;
  &amp;quot;Mar&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2),&lt;br /&gt;
  &amp;quot;Apr&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2),&lt;br /&gt;
  &amp;quot;May&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2),&lt;br /&gt;
  &amp;quot;Jun&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2),&lt;br /&gt;
  &amp;quot;Jul&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2),&lt;br /&gt;
  &amp;quot;Aug&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2),&lt;br /&gt;
  &amp;quot;Sep&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2),&lt;br /&gt;
  &amp;quot;Oct&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2),&lt;br /&gt;
  &amp;quot;Nov&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2),&lt;br /&gt;
  &amp;quot;Dec&amp;quot;&amp;amp;&amp;quot;-&amp;quot;&amp;amp;right(ri!year, 2)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Let me know if you face any problems in executing the code.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47669?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 01:41:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d377363d-e74f-4c19-9447-9c321660b70f</guid><dc:creator>vinod alla</dc:creator><description>Ramesh,&lt;br /&gt;
&lt;br /&gt;
If the difference between ( local!toYear, local!fromYear )&amp;gt;1 only the boundary year months are  displaying.&lt;br /&gt;
&lt;br /&gt;
For example start date Sep   - 2015 and To date Feb -2017 , Displaying {Sep-15, Oct -15, Nov-15, Dec-15, Jan-17, Feb-17}&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47582?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2017 18:17:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1a70e1b9-a349-4a77-a694-297236423423</guid><dc:creator>Ram</dc:creator><description>Welcome Vinod&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47581?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2017 18:14:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e441d235-6324-4ab8-8953-a251cf3e87fa</guid><dc:creator>vinod alla</dc:creator><description>Perfect - Ramesh, Now working as expected.&lt;br /&gt;
&lt;br /&gt;
Thank you so much&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47577?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2017 17:55:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d5840666-6502-47f3-8d90-84817a71f592</guid><dc:creator>Ram</dc:creator><description>Hi Vinod,&lt;br /&gt;
&lt;br /&gt;
Try replacing the below code i.e. code at line 11. &lt;br /&gt;
&lt;br /&gt;
fn!apply(append(_, &amp;quot;-&amp;quot;&amp;amp;right(local!fromYear, 2)), {difference({fn!apply(fn!displayvalue(_, cons!TEST_MONTH_NUMBERS, cons!TEST_MONTHS, null), {enumerate(local!toMonth) + local!fromMonth})}, {null})})&lt;br /&gt;
&lt;br /&gt;
with&lt;br /&gt;
&lt;br /&gt;
fn!apply(append(_, &amp;quot;-&amp;quot;&amp;amp;right(local!fromYear, 2)), {difference({fn!apply(fn!displayvalue(_, cons!TEST_MONTH_NUMBERS, cons!TEST_MONTHS, null), {enumerate(local!toMonth + 1 - local!fromMonth) + local!fromMonth})}, {null})}),&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Ramesh&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47566?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2017 16:46:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cbb157b6-f965-40ec-9fc4-e25d9adc92d4</guid><dc:creator>vinod alla</dc:creator><description>Thank you  so much - Ramesh,&lt;br /&gt;
 It is working fine if the year is different.&lt;br /&gt;
But if year is same( example: start date: 04/04/2017,  end Date: 10/04/2017) displaying from Apr-17 to Dec-17.&lt;br /&gt;
displaying 3+ months .&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47563?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2017 15:33:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:04f4f991-a572-4bce-b258-3c2dbb9582b8</guid><dc:creator>Ram</dc:creator><description>Hi Vinod,&lt;br /&gt;
&lt;br /&gt;
Please use the below code snippet in an expression rule which fulfills the above mentioned requirement.&lt;br /&gt;
&lt;br /&gt;
with(&lt;br /&gt;
  local!fromMonth: month(ri!fromDatetime),&lt;br /&gt;
  local!toMonth: month(ri!toDatetime),&lt;br /&gt;
  local!fromYear: year(ri!fromDatetime),&lt;br /&gt;
  local!toYear: year(ri!toDatetime),&lt;br /&gt;
  if(and(local!fromYear = local!toYear, local!fromMonth &amp;gt; local!toMonth),&lt;br /&gt;
    &amp;quot;From date should be less than to date&amp;quot;,&lt;br /&gt;
    if(local!fromYear &amp;gt; local!toYear,&lt;br /&gt;
      &amp;quot;From date should be less than to date&amp;quot;,&lt;br /&gt;
      if(local!fromYear = local!toYear,&lt;br /&gt;
        fn!apply(append(_, &amp;quot;-&amp;quot;&amp;amp;right(local!fromYear, 2)), {difference({fn!apply(fn!displayvalue(_, cons!TEST_MONTH_NUMBERS, cons!TEST_MONTHS, null), {enumerate(local!toMonth) + local!fromMonth})}, {null})}),&lt;br /&gt;
        if(local!fromYear &amp;lt; local!toYear,&lt;br /&gt;
          append(&lt;br /&gt;
            fn!apply(append(_, &amp;quot;-&amp;quot;&amp;amp;right(local!fromYear, 2)), {difference({fn!apply(fn!displayvalue(_, cons!TEST_MONTH_NUMBERS, cons!TEST_MONTHS, null), {enumerate(12) + local!fromMonth})}, {null})}),&lt;br /&gt;
            fn!apply(append(_, &amp;quot;-&amp;quot;&amp;amp;right(local!toYear, 2)), {difference({fn!apply(fn!displayvalue(_, cons!TEST_MONTH_NUMBERS, cons!TEST_MONTHS, null), {enumerate(local!toMonth) + 1})}, {null})})&lt;br /&gt;
          ),&lt;br /&gt;
          null&lt;br /&gt;
        )&lt;br /&gt;
      )&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
cons!TEST_MONTH_NUMBERS: Contains {1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12} array.&lt;br /&gt;
cons!TEST_MONTHS: Contains {Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec} array&lt;br /&gt;
&lt;br /&gt;
Please let me know if you face any trouble in executing the code snippet&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Ramesh&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47562?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2017 15:14:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6c01c3c2-a7a1-4415-a03e-c1dc23fd6832</guid><dc:creator>andriyr</dc:creator><description>But shouldn&amp;#39;t there be more months between the two dates you listed? Assuming dates are formatted D/M/Y then your example would output something like &amp;quot;Dec. 16&amp;quot;, &amp;quot;Jan. 17&amp;quot;, ... , &amp;quot;Nov. 17&amp;quot;.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47558?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2017 14:51:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3246d920-1916-4f72-8846-d2b7bd163701</guid><dc:creator>vinod alla</dc:creator><description>Raggie - End result should be  in the format of( Dec-16, Jan-17, Feb-17)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47557?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2017 14:45:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3b9c6a7c-3d67-427b-b155-53792ec64688</guid><dc:creator>Reggie</dc:creator><description>For clarification, should the end result be the # of months between start and end date? &lt;br /&gt;
&lt;br /&gt;
OR &lt;br /&gt;
&lt;br /&gt;
Should the end result be in the format of your example (Dec-16, Jan-17, Feb-17) based on each month between start and end date?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How could we  get the months between  the start date and end date</title><link>https://community.appian.com/thread/47555?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2017 14:34:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3d89e0a7-ea91-482b-909b-53ac11b7670e</guid><dc:creator>Alok Patro</dc:creator><description>as per your example the months should be from December-16 till November-17 ..&lt;br /&gt;
&lt;br /&gt;
Can you please clarify your requirement. and give another example&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>