<?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: Date / Time Formatting Issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/238375#M308747</link>
    <description>&lt;P&gt;This is a datetime variable according to the format.&amp;nbsp; Does your data have time stamps associated with the dates?&amp;nbsp; Or are all the values of the time part of p_created_date equal to 00:00:00?&amp;nbsp; The where statement is saying that you want any p_created_date between Sept 15, 2015 at 6:00 PM through Sept 25, 2015 at 6:00 PM.&amp;nbsp; If you are trying to limit it with the 6:00 PM and are having issues (which I would suggest posting what the issues are), I would try eliminating the ".000000" from your datetime ranges and modifying d to dt at the end.&amp;nbsp; If you are not intending to limit it with the 6:00 PM, I would suggest either changing the 18 to 00 and adding dt instead of d at the end, or just using the datepart() function of p_created_date and removing everything after the 2015 in your limits.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Dec 2015 20:08:31 GMT</pubDate>
    <dc:creator>dcruik</dc:creator>
    <dc:date>2015-12-08T20:08:31Z</dc:date>
    <item>
      <title>Date / Time Formatting Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/238372#M308745</link>
      <description>&lt;P&gt;I have a date variable that I am trying to report on for a specific range.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I am having issues tring to get the formatting of the code right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The date format is as follows - DDMONYEAR:00:00:00.000000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the following code -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Quotes;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; test.client&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;= (&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'15SEP2015:18:00:00.000000'd&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;lt;= p_created_date &amp;lt;= &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'25SEP2015:18:00:00.000000'd&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;keep&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;FONT face="Courier New" size="3"&gt;p_created_date &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any and all help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joshua&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 20:12:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/238372#M308745</guid>
      <dc:creator>joshua_james</dc:creator>
      <dc:date>2015-12-08T20:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date / Time Formatting Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/238374#M308746</link>
      <description>&lt;P&gt;Looks like a DATETIME value, use DT instead of D for the literal.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 20:07:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/238374#M308746</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-12-08T20:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Date / Time Formatting Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/238375#M308747</link>
      <description>&lt;P&gt;This is a datetime variable according to the format.&amp;nbsp; Does your data have time stamps associated with the dates?&amp;nbsp; Or are all the values of the time part of p_created_date equal to 00:00:00?&amp;nbsp; The where statement is saying that you want any p_created_date between Sept 15, 2015 at 6:00 PM through Sept 25, 2015 at 6:00 PM.&amp;nbsp; If you are trying to limit it with the 6:00 PM and are having issues (which I would suggest posting what the issues are), I would try eliminating the ".000000" from your datetime ranges and modifying d to dt at the end.&amp;nbsp; If you are not intending to limit it with the 6:00 PM, I would suggest either changing the 18 to 00 and adding dt instead of d at the end, or just using the datepart() function of p_created_date and removing everything after the 2015 in your limits.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 20:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/238375#M308747</guid>
      <dc:creator>dcruik</dc:creator>
      <dc:date>2015-12-08T20:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date / Time Formatting Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/238378#M308748</link>
      <description>&lt;P&gt;You have to remain consistent with date or datepart.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;range1 = '15SEP2015:18:00:00.000000'dt;&lt;BR /&gt;range2 = '25SEP2015:18:00:00.000000'dt;&lt;BR /&gt;p_create = '20SEP2015:18:00:00.000000'dt;&lt;BR /&gt;format range1 range2 p_create datetime25.;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;if range1 &amp;lt; p_create &amp;lt; range2 then yes = 'yes';&lt;BR /&gt;if datepart(range1) &amp;lt; '20sep2015'd &amp;lt; datepart(range2) then check = 'yes';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 20:22:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Time-Formatting-Issue/m-p/238378#M308748</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-12-08T20:22:37Z</dc:date>
    </item>
  </channel>
</rss>

