<?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 SQL Syntax for table select in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/sql-syntax-for-table-select/m-p/466448#M36459</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi i am trying to perform a table select on a file gdb table using the table select tool in python. It is a date field and i can get find the syntax error. I am sure it something simple. any suggestions are appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.TableSelect_analysis(table,nt,"date" &amp;gt;= 'date' '2012-01-02 00:00:00' and "date" &amp;lt;= 'date' '2012-01-04 00:00:00'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Nov 2013 21:24:44 GMT</pubDate>
    <dc:creator>AndrewRadford1</dc:creator>
    <dc:date>2013-11-18T21:24:44Z</dc:date>
    <item>
      <title>SQL Syntax for table select</title>
      <link>https://community.esri.com/t5/python-questions/sql-syntax-for-table-select/m-p/466448#M36459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi i am trying to perform a table select on a file gdb table using the table select tool in python. It is a date field and i can get find the syntax error. I am sure it something simple. any suggestions are appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.TableSelect_analysis(table,nt,"date" &amp;gt;= 'date' '2012-01-02 00:00:00' and "date" &amp;lt;= 'date' '2012-01-04 00:00:00'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 21:24:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sql-syntax-for-table-select/m-p/466448#M36459</guid>
      <dc:creator>AndrewRadford1</dc:creator>
      <dc:date>2013-11-18T21:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Syntax for table select</title>
      <link>https://community.esri.com/t5/python-questions/sql-syntax-for-table-select/m-p/466449#M36460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think your query for a file gdb needs to be similar to this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'"date" &amp;gt;= date \'2012-01-02 00:00:00\' and "date" &amp;lt;= date \'2012-01-04 00:00:00\''&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, then this untested snippet:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
qry = '"date" &amp;gt;= date \'2012-01-02 00:00:00\' and "date" &amp;lt;= date \'2012-01-04 00:00:00\''
arcpy.TableSelect_analysis(table, nt, qry)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:41:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sql-syntax-for-table-select/m-p/466449#M36460</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-11T20:41:32Z</dc:date>
    </item>
  </channel>
</rss>

