<?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 select records where the date (in date time format) is less than today in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/select-records-where-the-date-in-date-time-format-is-less-than/m-p/360078#M84707</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a field (table_date) that's in date time format: (sample: 08MAY2017:08:00:00.000) and I want to select records where the date is less than today()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is what I have so far but it's not working&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table temp_del1&lt;BR /&gt;as&lt;BR /&gt;select * from temp_weekly_data&lt;BR /&gt;where&lt;BR /&gt;datepart(table_date) &amp;lt; datepart(today());&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please advise&lt;/P&gt;</description>
    <pubDate>Fri, 19 May 2017 18:46:34 GMT</pubDate>
    <dc:creator>tparvaiz</dc:creator>
    <dc:date>2017-05-19T18:46:34Z</dc:date>
    <item>
      <title>select records where the date (in date time format) is less than today</title>
      <link>https://communities.sas.com/t5/SAS-Programming/select-records-where-the-date-in-date-time-format-is-less-than/m-p/360078#M84707</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a field (table_date) that's in date time format: (sample: 08MAY2017:08:00:00.000) and I want to select records where the date is less than today()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is what I have so far but it's not working&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table temp_del1&lt;BR /&gt;as&lt;BR /&gt;select * from temp_weekly_data&lt;BR /&gt;where&lt;BR /&gt;datepart(table_date) &amp;lt; datepart(today());&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please advise&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 18:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/select-records-where-the-date-in-date-time-format-is-less-than/m-p/360078#M84707</guid>
      <dc:creator>tparvaiz</dc:creator>
      <dc:date>2017-05-19T18:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: select records where the date (in date time format) is less than today</title>
      <link>https://communities.sas.com/t5/SAS-Programming/select-records-where-the-date-in-date-time-format-is-less-than/m-p/360081#M84708</link>
      <description>&lt;P&gt;Remove the datepart function from the today() function. i.e.,&lt;/P&gt;
&lt;PRE&gt;datepart(table_date) &amp;lt; today();&lt;/PRE&gt;
&lt;P&gt;Also, end your proc sql call with a quit; rather than a run; statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 18:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/select-records-where-the-date-in-date-time-format-is-less-than/m-p/360081#M84708</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-19T18:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: select records where the date (in date time format) is less than today</title>
      <link>https://communities.sas.com/t5/SAS-Programming/select-records-where-the-date-in-date-time-format-is-less-than/m-p/360091#M84711</link>
      <description>&lt;P&gt;thanks for your assistance&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 19:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/select-records-where-the-date-in-date-time-format-is-less-than/m-p/360091#M84711</guid>
      <dc:creator>tparvaiz</dc:creator>
      <dc:date>2017-05-19T19:47:54Z</dc:date>
    </item>
  </channel>
</rss>

