<?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: Proc SQL SELECT issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435966#M108345</link>
    <description>&lt;P&gt;that is because no rows meet your where condition and your year 1700 and 1723 looks kind of odd to me.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Feb 2018 17:23:13 GMT</pubDate>
    <dc:creator>kiranv_</dc:creator>
    <dc:date>2018-02-10T17:23:13Z</dc:date>
    <item>
      <title>Proc SQL SELECT issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435923#M108326</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having an issue with a proc sql command. &amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	select price from sasuser.ERCOT
	where Date &amp;gt;= '01Jun1700:00:00'd and Date &amp;lt;= '31Dec1723:00:00'd;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As you can see from the code I am just trying to grab prices from a certain date-time range.I have attached the csv file I used to import the data.&amp;nbsp; I don't receive any errors but the log does say that 0 rows were selected.&amp;nbsp; I am not sure what I am missing here as this is a pretty straight forward sql query.&amp;nbsp; SAS documentation not helping me here unfortunately.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 05:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435923#M108326</guid>
      <dc:creator>atsprink</dc:creator>
      <dc:date>2018-02-10T05:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL SELECT issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435929#M108332</link>
      <description>&lt;P&gt;Those are date times they need a DT after the quotes not a D.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DT -&amp;gt; DateTime&lt;/P&gt;
&lt;P&gt;D -&amp;gt; Date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189335"&gt;@atsprink&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am having an issue with a proc sql command. &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	select price from sasuser.ERCOT
	where Date &amp;gt;= '01Jun1700:00:00'd and Date &amp;lt;= '31Dec1723:00:00'd;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As you can see from the code I am just trying to grab prices from a certain date-time range.I have attached the csv file I used to import the data.&amp;nbsp; I don't receive any errors but the log does say that 0 rows were selected.&amp;nbsp; I am not sure what I am missing here as this is a pretty straight forward sql query.&amp;nbsp; SAS documentation not helping me here unfortunately.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 05:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435929#M108332</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-10T05:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL SELECT issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435957#M108343</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your solution and it still says 0 rows were selected.&amp;nbsp; I realized I had the wrong date time in the original question so it has been updated here.&amp;nbsp; Here is what my log shows me after running the script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;77
78 * QUESTION 2;
79 * filter data first to june-september;
80 proc sql;
81 select Price from sasuser.ERCOT
82 where Date &amp;gt;= '01JUN1700:00:00'dt and Date &amp;lt;= '30SEP1723:00:00'dt;
NOTE: No rows were selected.
83 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 16:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435957#M108343</guid>
      <dc:creator>atsprink</dc:creator>
      <dc:date>2018-02-10T16:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL SELECT issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435966#M108345</link>
      <description>&lt;P&gt;that is because no rows meet your where condition and your year 1700 and 1723 looks kind of odd to me.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 17:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435966#M108345</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-02-10T17:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL SELECT issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435967#M108346</link>
      <description>&lt;P&gt;your date values in CSV file are not quite sas datetime values for sas to recognize. You can read the first value just as a date value and still filter with sas date constant&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1/1/2017&lt;/STRONG&gt; 0:00 23.3575 LZ_AEN&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1/1/2017&lt;/STRONG&gt; can be read as a sas date value and then you could filter with a whatever sas date constant&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 17:23:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435967#M108346</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-02-10T17:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL SELECT issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435968#M108347</link>
      <description>&lt;P&gt;Hi kiranv_,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I think I may have found the issue given your reply.&amp;nbsp; The datetime should be read as 01Jun17 00:00:00 through 30Sep17 23:00:00, so June 1 2017 at 12:00 am through Sept 30 11:00 pm.&amp;nbsp; Should I separate the year and time within the single quotes?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 17:34:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435968#M108347</guid>
      <dc:creator>atsprink</dc:creator>
      <dc:date>2018-02-10T17:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL SELECT issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435969#M108348</link>
      <description>&lt;P&gt;Yep as soon as I space changed the datetime to '01Jun17 00:00:00' it worked.&amp;nbsp; I forgot to put a space between the year and hour.&amp;nbsp; Thank you for your comment about the time looking weird.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 17:36:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-SELECT-issue/m-p/435969#M108348</guid>
      <dc:creator>atsprink</dc:creator>
      <dc:date>2018-02-10T17:36:27Z</dc:date>
    </item>
  </channel>
</rss>

