<?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: Where clause datetime format in Proc SQL SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Where-clause-datetime-format-in-Proc-SQL-SAS/m-p/183001#M265345</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Dbailey,&lt;/P&gt;&lt;P&gt;first time when I ran it, it took time and but could not give any result in the log window the query was printed as it is w/o any note or error (actually it had a syntax error as Arthur mentioned).&lt;/P&gt;&lt;P&gt;Arthur thank you too, both trans_date and transaction_date are one and the same, it is just a typo error. I rectified it.&lt;/P&gt;&lt;P&gt;Will wait to see the query resolved. I was confused not sure for the code since transaction_date/trans_date is in datetime format.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Dec 2013 17:22:37 GMT</pubDate>
    <dc:creator>Dipu</dc:creator>
    <dc:date>2013-12-27T17:22:37Z</dc:date>
    <item>
      <title>Where clause datetime format in Proc SQL SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-clause-datetime-format-in-Proc-SQL-SAS/m-p/182998#M265342</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 to get the transaction between 13Sep2013 and 23Oct2013. Is this a correct syntax??&lt;/P&gt;&lt;P&gt;Where trans_date variable is in datetime format i.e. 23OCt2013:00:00:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;Select &lt;/P&gt;&lt;P&gt;Trans_date&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;from m1.transaction&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;where&amp;nbsp; datepart (transaction_date) between '13Sep2013'd and 23Oct2013'd&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please guide&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Dec 2013 16:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-clause-datetime-format-in-Proc-SQL-SAS/m-p/182998#M265342</guid>
      <dc:creator>Dipu</dc:creator>
      <dc:date>2013-12-27T16:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Where clause datetime format in Proc SQL SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-clause-datetime-format-in-Proc-SQL-SAS/m-p/182999#M265343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That should work as it truncates the time portion to the date.&amp;nbsp; You do have to be careful about using data from external databases that might not support the datepart function.&amp;nbsp; SAS can't pass that function through to the external database and so it would return all rows and perform the selection locally.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you having issues with the query as it is currently constructed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Dec 2013 17:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-clause-datetime-format-in-Proc-SQL-SAS/m-p/182999#M265343</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-12-27T17:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Where clause datetime format in Proc SQL SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-clause-datetime-format-in-Proc-SQL-SAS/m-p/183000#M265344</link>
      <description>&lt;P&gt;You are using both trans_date and transaction_date .. are there really two different fields?&lt;/P&gt;
&lt;P&gt;Also, you are missing a quote before the 2nd date and need a semi-colon before the quit statement.&amp;nbsp; i.e.,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
&amp;nbsp; Select Trans_date
&amp;nbsp;&amp;nbsp;&amp;nbsp; from transaction
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp; datepart (trans_date) between '13Sep2013'd and '23Oct2013'd
&amp;nbsp; ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 13:57:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-clause-datetime-format-in-Proc-SQL-SAS/m-p/183000#M265344</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2016-10-28T13:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Where clause datetime format in Proc SQL SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-clause-datetime-format-in-Proc-SQL-SAS/m-p/183001#M265345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Dbailey,&lt;/P&gt;&lt;P&gt;first time when I ran it, it took time and but could not give any result in the log window the query was printed as it is w/o any note or error (actually it had a syntax error as Arthur mentioned).&lt;/P&gt;&lt;P&gt;Arthur thank you too, both trans_date and transaction_date are one and the same, it is just a typo error. I rectified it.&lt;/P&gt;&lt;P&gt;Will wait to see the query resolved. I was confused not sure for the code since transaction_date/trans_date is in datetime format.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Dec 2013 17:22:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-clause-datetime-format-in-Proc-SQL-SAS/m-p/183001#M265345</guid>
      <dc:creator>Dipu</dc:creator>
      <dc:date>2013-12-27T17:22:37Z</dc:date>
    </item>
  </channel>
</rss>

