<?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 Different results for the same two dates in INTCK function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Different-results-for-the-same-two-dates-in-INTCK-function/m-p/803605#M316439</link>
    <description>&lt;P&gt;Hi, I met a problem when calculating the difference of months between two dates. Here are the sample codes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	dt1 = "25Aug2011"d;
	dt2 = "23Feb2012"d;
	dt1_dt2 = intck("month",dt1,dt2,"c");
	dt2_dt1 = intck("month",dt2,dt1,"c");
	format dt1 dt2: yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here I calculated the month difference between date1 2011-08-25 and date2 2012-02-23. When I put date1 before date2 (dt1_dt2) in the INTCK function, it returns 5, because the time interval is slightly &amp;lt;6 months. However, when I put date2 before date1 (dt2_dt1), it returns -6. Shouldn't it be -5, since I just changed the order of two dates? Anyone can help me with it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Mar 2022 17:04:35 GMT</pubDate>
    <dc:creator>Chaupak</dc:creator>
    <dc:date>2022-03-23T17:04:35Z</dc:date>
    <item>
      <title>Different results for the same two dates in INTCK function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-results-for-the-same-two-dates-in-INTCK-function/m-p/803605#M316439</link>
      <description>&lt;P&gt;Hi, I met a problem when calculating the difference of months between two dates. Here are the sample codes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	dt1 = "25Aug2011"d;
	dt2 = "23Feb2012"d;
	dt1_dt2 = intck("month",dt1,dt2,"c");
	dt2_dt1 = intck("month",dt2,dt1,"c");
	format dt1 dt2: yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here I calculated the month difference between date1 2011-08-25 and date2 2012-02-23. When I put date1 before date2 (dt1_dt2) in the INTCK function, it returns 5, because the time interval is slightly &amp;lt;6 months. However, when I put date2 before date1 (dt2_dt1), it returns -6. Shouldn't it be -5, since I just changed the order of two dates? Anyone can help me with it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 17:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-results-for-the-same-two-dates-in-INTCK-function/m-p/803605#M316439</guid>
      <dc:creator>Chaupak</dc:creator>
      <dc:date>2022-03-23T17:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Different results for the same two dates in INTCK function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-results-for-the-same-two-dates-in-INTCK-function/m-p/803609#M316442</link>
      <description>&lt;P&gt;One month from 23FEB2012 is any date 23MAR2012 to 22APR 2012&lt;/P&gt;
&lt;P&gt;Zero months from 23FEB2012 is any date 23FEB2012 to 22MAR2012.&lt;/P&gt;
&lt;P&gt;Negative one months is any date 23JAN2012 to 22FEB2012 (so 23FEB2012 to 22FEB2012 on this scale is -1 months)&lt;/P&gt;
&lt;P&gt;and so on&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 17:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-results-for-the-same-two-dates-in-INTCK-function/m-p/803609#M316442</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-23T17:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Different results for the same two dates in INTCK function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-results-for-the-same-two-dates-in-INTCK-function/m-p/803611#M316443</link>
      <description>Thank you so much!</description>
      <pubDate>Wed, 23 Mar 2022 17:26:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-results-for-the-same-two-dates-in-INTCK-function/m-p/803611#M316443</guid>
      <dc:creator>Chaupak</dc:creator>
      <dc:date>2022-03-23T17:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Different results for the same two dates in INTCK function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-results-for-the-same-two-dates-in-INTCK-function/m-p/803726#M316472</link>
      <description>&lt;P&gt;Another way to put it.&amp;nbsp; When you count down there is no negative zero.&amp;nbsp; The sequence is 2,1,0,-1,-2.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 02:39:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-results-for-the-same-two-dates-in-INTCK-function/m-p/803726#M316472</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-24T02:39:24Z</dc:date>
    </item>
  </channel>
</rss>

