<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Numer of months between 2 dates in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Numer-of-months-between-2-dates/m-p/542777#M7606</link>
    <description>&lt;P&gt;I'm trying to get to a more&amp;nbsp;precise number of months between 2 dates than given by the INTCK function.&lt;/P&gt;&lt;P&gt;For example: INTCK('MONTH','15MAR2018'd,11MAR2019'd) returns 12 even though the difference is less than 12 month (by 4 days).&lt;/P&gt;&lt;P&gt;Is there a way I could return only the number of pull months between 2 dates? Or return a decimal representation of the number of months (11.93) between 2 dates?&amp;nbsp; Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2019 13:26:01 GMT</pubDate>
    <dc:creator>dee3bee</dc:creator>
    <dc:date>2019-03-13T13:26:01Z</dc:date>
    <item>
      <title>Numer of months between 2 dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Numer-of-months-between-2-dates/m-p/542777#M7606</link>
      <description>&lt;P&gt;I'm trying to get to a more&amp;nbsp;precise number of months between 2 dates than given by the INTCK function.&lt;/P&gt;&lt;P&gt;For example: INTCK('MONTH','15MAR2018'd,11MAR2019'd) returns 12 even though the difference is less than 12 month (by 4 days).&lt;/P&gt;&lt;P&gt;Is there a way I could return only the number of pull months between 2 dates? Or return a decimal representation of the number of months (11.93) between 2 dates?&amp;nbsp; Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 13:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Numer-of-months-between-2-dates/m-p/542777#M7606</guid>
      <dc:creator>dee3bee</dc:creator>
      <dc:date>2019-03-13T13:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Numer of months between 2 dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Numer-of-months-between-2-dates/m-p/542781#M7607</link>
      <description>&lt;P&gt;It's probably most accurate to compute number of days:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;n_days = '11MAR2019'd - '15MAR2018'd;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can convert that using any formula that you want, such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;n_months = n_days / 30.25;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;n_months = n_days / 365.25 * 12;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 13:33:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Numer-of-months-between-2-dates/m-p/542781#M7607</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-03-13T13:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Numer of months between 2 dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Numer-of-months-between-2-dates/m-p/542855#M7617</link>
      <description>&lt;P&gt;Try using the 'C' modifier to the INTCK function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  x=INTCK('MONTH','15MAR2018'd,'11MAR2019'd);
  y=INTCK('MONTH','15MAR2018'd,'11MAR2019'd,'C');
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will give Y=11 which is the number of whole months &amp;nbsp;between the 2 dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Lawrence&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 16:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Numer-of-months-between-2-dates/m-p/542855#M7617</guid>
      <dc:creator>LawrenceHW</dc:creator>
      <dc:date>2019-03-13T16:10:48Z</dc:date>
    </item>
  </channel>
</rss>

