<?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: Calculating difference in Date/Time fields in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculating-difference-in-Date-Time-fields/m-p/881559#M348332</link>
    <description>&lt;P&gt;INTCK("interval",ACTION_END_DTM , ACTION_START_DTM)&lt;BR /&gt;&lt;BR /&gt;You need to specify the interval, ie minute, day, month, week, not interval. &lt;BR /&gt;&lt;BR /&gt;Or format AHT, &lt;BR /&gt;&lt;BR /&gt;action_end_dtm - action_start_dtm as aht format=time. ....&lt;BR /&gt;&lt;BR /&gt;You also need to give them unique variable names and your subtracting the same variable from itself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/263957"&gt;@Jyuen204&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a data set with a Start and End Datetime.&lt;/P&gt;
&lt;P&gt;Trying a few things to compute the difference between the end and start time.&lt;/P&gt;
&lt;P&gt;But the results (below) are not getting anything back.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="xis-code"&gt;proc sql outobs=100;&lt;BR /&gt;select ACTION_END_DTM, ACTION_START_DTM, ACTION_START_DTM-ACTION_START_DTM as AHT, INTCK("interval",ACTION_END_DTM , ACTION_START_DTM) as AHT from calls_closed;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jyuen204_0-1687279751901.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85174iE46199F732F17489/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jyuen204_0-1687279751901.png" alt="Jyuen204_0-1687279751901.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jun 2023 16:53:36 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2023-06-20T16:53:36Z</dc:date>
    <item>
      <title>Calculating difference in Date/Time fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-difference-in-Date-Time-fields/m-p/881558#M348331</link>
      <description>&lt;P&gt;I have a data set with a Start and End Datetime.&lt;/P&gt;
&lt;P&gt;Trying a few things to compute the difference between the end and start time.&lt;/P&gt;
&lt;P&gt;But the results (below) are not getting anything back.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="xis-code"&gt;proc sql outobs=100;&lt;BR /&gt;select ACTION_END_DTM, ACTION_START_DTM, ACTION_START_DTM-ACTION_START_DTM as AHT, INTCK("interval",ACTION_END_DTM , ACTION_START_DTM) as AHT from calls_closed;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jyuen204_0-1687279751901.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85174iE46199F732F17489/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jyuen204_0-1687279751901.png" alt="Jyuen204_0-1687279751901.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 16:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-difference-in-Date-Time-fields/m-p/881558#M348331</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2023-06-20T16:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating difference in Date/Time fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-difference-in-Date-Time-fields/m-p/881559#M348332</link>
      <description>&lt;P&gt;INTCK("interval",ACTION_END_DTM , ACTION_START_DTM)&lt;BR /&gt;&lt;BR /&gt;You need to specify the interval, ie minute, day, month, week, not interval. &lt;BR /&gt;&lt;BR /&gt;Or format AHT, &lt;BR /&gt;&lt;BR /&gt;action_end_dtm - action_start_dtm as aht format=time. ....&lt;BR /&gt;&lt;BR /&gt;You also need to give them unique variable names and your subtracting the same variable from itself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/263957"&gt;@Jyuen204&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a data set with a Start and End Datetime.&lt;/P&gt;
&lt;P&gt;Trying a few things to compute the difference between the end and start time.&lt;/P&gt;
&lt;P&gt;But the results (below) are not getting anything back.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="xis-code"&gt;proc sql outobs=100;&lt;BR /&gt;select ACTION_END_DTM, ACTION_START_DTM, ACTION_START_DTM-ACTION_START_DTM as AHT, INTCK("interval",ACTION_END_DTM , ACTION_START_DTM) as AHT from calls_closed;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jyuen204_0-1687279751901.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85174iE46199F732F17489/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jyuen204_0-1687279751901.png" alt="Jyuen204_0-1687279751901.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 16:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-difference-in-Date-Time-fields/m-p/881559#M348332</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-20T16:53:36Z</dc:date>
    </item>
  </channel>
</rss>

