<?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: I can not extract part of a date in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/I-can-not-extract-part-of-a-date/m-p/296225#M20199</link>
    <description>&lt;P&gt;Its hard to see because your pictures don't show clearly enough but I think you have a datetime not a date variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The functions Year/Month/Day require a date. To convert your datetime to a date use the DATEPART() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Year(datepart(date_var))&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 02 Sep 2016 20:01:40 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-09-02T20:01:40Z</dc:date>
    <item>
      <title>I can not extract part of a date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/I-can-not-extract-part-of-a-date/m-p/296221#M20198</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class=""&gt;I have&lt;/SPAN&gt; &lt;SPAN class=""&gt;this table&lt;/SPAN&gt; &lt;SPAN&gt;with some&lt;/SPAN&gt; &lt;SPAN&gt;fields of type&lt;/SPAN&gt; &lt;SPAN class=""&gt;date&lt;/SPAN&gt;&lt;/SPAN&gt; (example, column DAT_INICIO_ENTREGA_PROPOSTA)&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4824i33E44C3889394E68/image-size/original?v=v2&amp;amp;px=-1" alt="sas1.png" title="sas1.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="g-unit"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="g-unit"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;When I try to extract the year (or month, or day), the result is null (.)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4825i80E5DC2E35E32FA5/image-size/original?v=v2&amp;amp;px=-1" alt="sas1.png" title="sas1.png" border="0" /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=""&gt;Help me.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 02 Sep 2016 19:51:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/I-can-not-extract-part-of-a-date/m-p/296221#M20198</guid>
      <dc:creator>fabiopjr</dc:creator>
      <dc:date>2016-09-02T19:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: I can not extract part of a date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/I-can-not-extract-part-of-a-date/m-p/296225#M20199</link>
      <description>&lt;P&gt;Its hard to see because your pictures don't show clearly enough but I think you have a datetime not a date variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The functions Year/Month/Day require a date. To convert your datetime to a date use the DATEPART() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Year(datepart(date_var))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Sep 2016 20:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/I-can-not-extract-part-of-a-date/m-p/296225#M20199</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-02T20:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: I can not extract part of a date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/I-can-not-extract-part-of-a-date/m-p/296227#M20200</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 20:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/I-can-not-extract-part-of-a-date/m-p/296227#M20200</guid>
      <dc:creator>fabiopjr</dc:creator>
      <dc:date>2016-09-02T20:06:16Z</dc:date>
    </item>
  </channel>
</rss>

