<?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 How to select an observation with a specific date and time in the datetime20. format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-an-observation-with-a-specific-date-and-time-in/m-p/947349#M370870</link>
    <description>&lt;P&gt;I have a table of observations with associated purchase date and time in the datetime20. format. However, I cannot seem to search by a specific date and time, I can only try to pull the observation by putting boundaries (re: greater than or less than) on the date and time. Is there &amp;nbsp;a where function I can use to just to pull it directly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have:&lt;/P&gt;
&lt;P&gt;obs &amp;nbsp; &amp;nbsp;Purchasedate. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Account&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;01Jun2024:19:48:02 &amp;nbsp; &amp;nbsp; A&lt;/SPAN&gt;&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;01Jun2024:20:22:01 &amp;nbsp; &amp;nbsp; B&lt;/SPAN&gt;&lt;BR /&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;01Jun2024:20:30:08 &amp;nbsp; &amp;nbsp;C&lt;/SPAN&gt;&lt;BR /&gt;4. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;01Jun2024:20:50:06 &amp;nbsp; &amp;nbsp;D&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Current code not working:&lt;BR /&gt;data temp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;set orders;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;where purchasedate = ‘01Jun2024:20:30:08’dt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I want to see in my result is Obs 3. However, it’s not pulling anything.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2024 09:10:19 GMT</pubDate>
    <dc:creator>ChickenLittle</dc:creator>
    <dc:date>2024-10-14T09:10:19Z</dc:date>
    <item>
      <title>How to select an observation with a specific date and time in the datetime20. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-an-observation-with-a-specific-date-and-time-in/m-p/947349#M370870</link>
      <description>&lt;P&gt;I have a table of observations with associated purchase date and time in the datetime20. format. However, I cannot seem to search by a specific date and time, I can only try to pull the observation by putting boundaries (re: greater than or less than) on the date and time. Is there &amp;nbsp;a where function I can use to just to pull it directly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have:&lt;/P&gt;
&lt;P&gt;obs &amp;nbsp; &amp;nbsp;Purchasedate. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Account&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;01Jun2024:19:48:02 &amp;nbsp; &amp;nbsp; A&lt;/SPAN&gt;&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;01Jun2024:20:22:01 &amp;nbsp; &amp;nbsp; B&lt;/SPAN&gt;&lt;BR /&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;01Jun2024:20:30:08 &amp;nbsp; &amp;nbsp;C&lt;/SPAN&gt;&lt;BR /&gt;4. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;01Jun2024:20:50:06 &amp;nbsp; &amp;nbsp;D&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Current code not working:&lt;BR /&gt;data temp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;set orders;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;where purchasedate = ‘01Jun2024:20:30:08’dt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I want to see in my result is Obs 3. However, it’s not pulling anything.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 09:10:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-an-observation-with-a-specific-date-and-time-in/m-p/947349#M370870</guid>
      <dc:creator>ChickenLittle</dc:creator>
      <dc:date>2024-10-14T09:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to select an observation with a specific date and time in the datetime20. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-an-observation-with-a-specific-date-and-time-in/m-p/947363#M370871</link>
      <description>&lt;P&gt;You have to remove the curly quotes and use straight quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
set orders;
where purchasedate = '01Jun2024:20:30:08'dt;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please&amp;nbsp; use code boxes from now on when you enter code. You click on the "little running man" icon and paste your code into the window that appears.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 10:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-an-observation-with-a-specific-date-and-time-in/m-p/947363#M370871</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-10-14T10:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to select an observation with a specific date and time in the datetime20. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-an-observation-with-a-specific-date-and-time-in/m-p/947365#M370872</link>
      <description>&lt;P&gt;Always (as in&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;ALWAYS&lt;/STRONG&gt;&lt;/U&gt;) post the complete log of the step that does not work as expected. The log is our #1 diagnostic tool, and there's a reason why Maxim 2 is second only to Maxim 1 (Read the Documentation).&lt;/P&gt;
&lt;P&gt;Copy/paste the log text into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your code did not throw an ERROR because of the curly quotes, then you most likely have fractions of a second in your datetime values. Use the ROUND function to remove them.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 11:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-an-observation-with-a-specific-date-and-time-in/m-p/947365#M370872</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-10-14T11:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to select an observation with a specific date and time in the datetime20. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-an-observation-with-a-specific-date-and-time-in/m-p/947374#M370874</link>
      <description>&lt;P&gt;The rounding was the trick! And thanks for pointing out the insert code feature. Really appreciate it!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 12:42:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-an-observation-with-a-specific-date-and-time-in/m-p/947374#M370874</guid>
      <dc:creator>ChickenLittle</dc:creator>
      <dc:date>2024-10-14T12:42:25Z</dc:date>
    </item>
  </channel>
</rss>

