<?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 Why isn't this query returning any records? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Why-isn-t-this-query-returning-any-records/m-p/193028#M48446</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table which contains multiple columns, one of the columns is call &lt;STRONG&gt;Date_Of&lt;/STRONG&gt; and it contains dates in the following format. &lt;STRONG&gt;ddMONyyy:hh:mm:ss&lt;/STRONG&gt; Ex. &lt;STRONG&gt;26MAY2015:00:00:00.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use a query in which I try to extract only records of today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SELECT t12.DATE_OF, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM QUERYt12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE t1.DATE_OF&amp;lt;=today();&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately the query doesn't extract any records, on the other hand if I switch the &lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt; operator to &lt;STRONG&gt;&amp;gt;&lt;/STRONG&gt; it extracts all the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it's related to the format of the date, I could't find a solution to this problem, hope someone will be able to help me out here.&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 May 2015 14:12:08 GMT</pubDate>
    <dc:creator>MustafaAbdelhaq</dc:creator>
    <dc:date>2015-05-26T14:12:08Z</dc:date>
    <item>
      <title>Why isn't this query returning any records?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-isn-t-this-query-returning-any-records/m-p/193028#M48446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table which contains multiple columns, one of the columns is call &lt;STRONG&gt;Date_Of&lt;/STRONG&gt; and it contains dates in the following format. &lt;STRONG&gt;ddMONyyy:hh:mm:ss&lt;/STRONG&gt; Ex. &lt;STRONG&gt;26MAY2015:00:00:00.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use a query in which I try to extract only records of today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SELECT t12.DATE_OF, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM QUERYt12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE t1.DATE_OF&amp;lt;=today();&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately the query doesn't extract any records, on the other hand if I switch the &lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt; operator to &lt;STRONG&gt;&amp;gt;&lt;/STRONG&gt; it extracts all the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it's related to the format of the date, I could't find a solution to this problem, hope someone will be able to help me out here.&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 14:12:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-isn-t-this-query-returning-any-records/m-p/193028#M48446</guid>
      <dc:creator>MustafaAbdelhaq</dc:creator>
      <dc:date>2015-05-26T14:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this query returning any records?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-isn-t-this-query-returning-any-records/m-p/193029#M48447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming t1.DATE_OF is a proper numeric data time value, then it includes date and time.&amp;nbsp; Today() function returns a date value, i.e. no time.&lt;/P&gt;&lt;P&gt;If you only want to compare dates then:&lt;/P&gt;&lt;P&gt;where datepart(T1.DATE_OF) &amp;lt;= today();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want time as well then you need to build a datetime response:&lt;/P&gt;&lt;P&gt;where T1.DATE_OF) &amp;lt;= dhms(today(),hour(time()),minute(time),0);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 14:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-isn-t-this-query-returning-any-records/m-p/193029#M48447</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-26T14:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this query returning any records?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-isn-t-this-query-returning-any-records/m-p/193030#M48448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As to the why: Today() returns a number of days since 1 Jan 1960 as are all SAS DATE valued variables. If your variable actually contains a DATETIME value as shown then the value stored is the number of SECONDS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 14:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-isn-t-this-query-returning-any-records/m-p/193030#M48448</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-05-26T14:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this query returning any records?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-isn-t-this-query-returning-any-records/m-p/193031#M48449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked perfectly, thank you so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 16:22:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-isn-t-this-query-returning-any-records/m-p/193031#M48449</guid>
      <dc:creator>MustafaAbdelhaq</dc:creator>
      <dc:date>2015-05-26T16:22:10Z</dc:date>
    </item>
  </channel>
</rss>

