<?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: INTCK + DATEPART in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-DATEPART/m-p/310160#M61272</link>
    <description>Datepart doesn't use a format as an argument.</description>
    <pubDate>Tue, 08 Nov 2016 16:46:01 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2016-11-08T16:46:01Z</dc:date>
    <item>
      <title>INTCK + DATEPART</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-DATEPART/m-p/310156#M61270</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use both INTCK and DATEPART function, but it gives me an error:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, *.&lt;/FONT&gt; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is my code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE Client_month AS&lt;BR /&gt;SELECT DISTINCT&lt;/P&gt;&lt;P&gt;t1.ID,&lt;BR /&gt;INTCK('month', today(), datepart(t1.client_datetime,&amp;nbsp;DATE9.)) as&amp;nbsp;MONTHS&lt;BR /&gt;FROM&amp;nbsp;Customers t1&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm trying to obtain a range in months between today() date and a date, that is in datetime format, therefore I'm trying to use datepart format date9 to get it in normal date format.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't figure it out. Could you please help?&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>Tue, 08 Nov 2016 16:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-DATEPART/m-p/310156#M61270</guid>
      <dc:creator>pkonopnicki</dc:creator>
      <dc:date>2016-11-08T16:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK + DATEPART</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-DATEPART/m-p/310160#M61272</link>
      <description>Datepart doesn't use a format as an argument.</description>
      <pubDate>Tue, 08 Nov 2016 16:46:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-DATEPART/m-p/310160#M61272</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-11-08T16:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK + DATEPART</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-DATEPART/m-p/310164#M61273</link>
      <description>Danke schon</description>
      <pubDate>Tue, 08 Nov 2016 16:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-DATEPART/m-p/310164#M61273</guid>
      <dc:creator>pkonopnicki</dc:creator>
      <dc:date>2016-11-08T16:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK + DATEPART</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-DATEPART/m-p/310165#M61274</link>
      <description>&lt;P&gt;Use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;INTCK('dtmonth', t1.client_datetime, datetime()) as MONTHS,&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;INTCK("MONTH", datepart(client_datetime), today()) as MONTHS,  &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Nov 2016 16:59:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-DATEPART/m-p/310165#M61274</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-11-08T16:59:27Z</dc:date>
    </item>
  </channel>
</rss>

