<?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 get all sundays in between given 2 dates?</title><link>https://community.appian.com/discussions/f/rules/10238/how-get-all-sundays-in-between-given-2-dates</link><description>Hi All, 
 how to get all Sundays in between given 2 dates - Holiday Periods?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: how get all sundays in between given 2 dates?</title><link>https://community.appian.com/thread/45398?ContentTypeID=1</link><pubDate>Wed, 10 May 2017 23:45:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:91480cba-e3fe-419e-9beb-36c592ba429d</guid><dc:creator>rajasekhard</dc:creator><description>No problem :)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how get all sundays in between given 2 dates?</title><link>https://community.appian.com/thread/45355?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 21:21:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:decf840c-0373-424c-818b-50818efc5b93</guid><dc:creator>aamayouf</dc:creator><description>Thank you for your help.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how get all sundays in between given 2 dates?</title><link>https://community.appian.com/thread/45199?ContentTypeID=1</link><pubDate>Wed, 03 May 2017 00:43:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:922d20f5-b4ae-46ab-a21e-c5b52a22fc64</guid><dc:creator>rajasekhard</dc:creator><description>&lt;p&gt;&lt;strong&gt;If you are looking to find the number of Sundays between two dates -&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1. Create a rule called TEST_addNumberToDate with following code&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;ri!date + ri!number&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;2. Then create another rule -&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;with(
  local!count: tointeger(ri!endDate - ri!startDate),
  local!totalDatesInRange: apply(rule!TEST_addNumberToDate(ri!startDate,_),enumerate(local!count)+1),
  local!dayOfTheWeek: apply(fn!weekday,local!totalDatesInRange),
  count(wherecontains(1,dayOfTheWeek))
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If you are looking to find the number of non working days between two dates, try below code -&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;with(
 local!int_totalNumberOfDays: tointeger(ri!endDate - ri!startDate),
 local!int_totalNumberOfWorkingDays: calworkdays(ri!startDate,ri!endDate),
 local!int_totalNumberOfNonWorkingDays: local!int_totalNumberOfDays - local!int_totalNumberOfWorkingDays,
 local!int_totalNumberOfNonWorkingDays
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>