<?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 Re: How to calculate time difference (minutes) between two datetime fields in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-calculate-time-difference-minutes-between-two-datetime/m-p/36494#M4557</link>
    <description>This is exactly what I wanted. Thanks very much!</description>
    <pubDate>Thu, 25 Mar 2010 18:17:30 GMT</pubDate>
    <dc:creator>Mantagon</dc:creator>
    <dc:date>2010-03-25T18:17:30Z</dc:date>
    <item>
      <title>How to calculate time difference (minutes) between two datetime fields</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-calculate-time-difference-minutes-between-two-datetime/m-p/36491#M4554</link>
      <description>I have two datetime fields and want to calculate the difference in minutes between the two fields.  I don't believe the DATDIF function will return minutes, will it?  Is there another function that I can use?  So far I haven't had any luck searching the SAS EG help or the web....&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.</description>
      <pubDate>Wed, 06 Aug 2008 12:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-calculate-time-difference-minutes-between-two-datetime/m-p/36491#M4554</guid>
      <dc:creator>mdavidson</dc:creator>
      <dc:date>2008-08-06T12:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate time difference (minutes) between two datetime fields</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-calculate-time-difference-minutes-between-two-datetime/m-p/36492#M4555</link>
      <description>Got it: INTCK('minute',field1,field2 )</description>
      <pubDate>Wed, 06 Aug 2008 13:32:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-calculate-time-difference-minutes-between-two-datetime/m-p/36492#M4555</guid>
      <dc:creator>mdavidson</dc:creator>
      <dc:date>2008-08-06T13:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate time difference (minutes) between two datetime fields</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-calculate-time-difference-minutes-between-two-datetime/m-p/36493#M4556</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16552"&gt;@mdavidson&lt;/a&gt; wrote:&lt;BR /&gt;&lt;SPAN&gt;got it: INTCK('minute',field1,field2 )&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;INTCK can give results that aren't what you want in all cases, as it counts from the beginning of the interval (see the &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p1md4mx2crzfaqn14va8kt7qvfhr.htm" target="_self"&gt;Details section of the documentation&lt;/A&gt;). If your data are recorded to the minute, it won't matter. If your data are recorded to the second, it might.&lt;BR /&gt; &lt;BR /&gt; As datetime variables are recorded in seconds, an alternative is to use the fact that there are 60 seconds in a minutes and just do the arithmetic directly&lt;BR /&gt; &lt;BR /&gt; (datetime2 - datetime1)/60 provides minutes with decimal fractions.&lt;BR /&gt; FLOOR( (datetime2 - datetime1)/60 ) provides the whole minute durations.&lt;BR /&gt; &lt;BR /&gt; For instance, 12:01:50 to 12:02:10 is 1 using INTCK, 0.333 using the decimal minutes, and 0 using the FLOOR version.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2016 17:33:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-calculate-time-difference-minutes-between-two-datetime/m-p/36493#M4556</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2016-07-26T17:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate time difference (minutes) between two datetime fields</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-calculate-time-difference-minutes-between-two-datetime/m-p/36494#M4557</link>
      <description>This is exactly what I wanted. Thanks very much!</description>
      <pubDate>Thu, 25 Mar 2010 18:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-calculate-time-difference-minutes-between-two-datetime/m-p/36494#M4557</guid>
      <dc:creator>Mantagon</dc:creator>
      <dc:date>2010-03-25T18:17:30Z</dc:date>
    </item>
  </channel>
</rss>

