<?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 INTCK('minute',X1,X2) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/INTCK-minute-X1-X2/m-p/830233#M328048</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Lets say that there are 2 columns :X1&lt;/P&gt;
&lt;P&gt;Each of them is sas date time column.&lt;/P&gt;
&lt;P&gt;Lets say that the formatted values are:&lt;/P&gt;
&lt;P&gt;X1=22AUG2022:09:35:00&lt;BR /&gt;X2=22AUG2022:09:26:06&lt;/P&gt;
&lt;P&gt;LEts say that I want to calculate the difference in minutes between X1 and X2.&lt;/P&gt;
&lt;P&gt;I am using intck as following:&amp;nbsp;&lt;BR /&gt;INTCK('minute',X1,X2) as dif_in_minutes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question:&lt;/P&gt;
&lt;P&gt;Why am I getting minus 9 and not plus 9???&lt;BR /&gt;I was sure that the difference that is calculated is X1-X2 by but the result I see that it is X2-X1&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2022 07:04:28 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2022-08-25T07:04:28Z</dc:date>
    <item>
      <title>INTCK('minute',X1,X2)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-minute-X1-X2/m-p/830233#M328048</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Lets say that there are 2 columns :X1&lt;/P&gt;
&lt;P&gt;Each of them is sas date time column.&lt;/P&gt;
&lt;P&gt;Lets say that the formatted values are:&lt;/P&gt;
&lt;P&gt;X1=22AUG2022:09:35:00&lt;BR /&gt;X2=22AUG2022:09:26:06&lt;/P&gt;
&lt;P&gt;LEts say that I want to calculate the difference in minutes between X1 and X2.&lt;/P&gt;
&lt;P&gt;I am using intck as following:&amp;nbsp;&lt;BR /&gt;INTCK('minute',X1,X2) as dif_in_minutes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question:&lt;/P&gt;
&lt;P&gt;Why am I getting minus 9 and not plus 9???&lt;BR /&gt;I was sure that the difference that is calculated is X1-X2 by but the result I see that it is X2-X1&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 07:04:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-minute-X1-X2/m-p/830233#M328048</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-08-25T07:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK('minute',X1,X2)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-minute-X1-X2/m-p/830234#M328049</link>
      <description>&lt;P&gt;The answer is quite simple. As the &lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/8.11/lefunctionsref/p1md4mx2crzfaqn14va8kt7qvfhr.htm" target="_self"&gt;INTCK Function Documentation&lt;/A&gt; says, it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Returns the number of interval boundaries of a given kind that lie between two dates, times, or datetime values.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;INTCK returns a negative value whenever the first date(time) is later than the second date(time) and the two date(time)s are not in the same discrete interval.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 07:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-minute-X1-X2/m-p/830234#M328049</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-08-25T07:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK('minute',X1,X2)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-minute-X1-X2/m-p/830238#M328050</link>
      <description>&lt;P&gt;The second argument is the &lt;U&gt;from&lt;/U&gt; value, and the third argument is the &lt;U&gt;to&lt;/U&gt; value. If "to" is before "from", the function returns a negative value.&lt;/P&gt;
&lt;P&gt;If you only want to get the difference, irrespective of the order, use the ABS function around the INTCK.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 07:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-minute-X1-X2/m-p/830238#M328050</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-08-25T07:48:26Z</dc:date>
    </item>
  </channel>
</rss>

