SQL Syntax for table select

332
1
11-18-2013 01:24 PM
AndrewRadford1
New Contributor
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.

arcpy.TableSelect_analysis(table,nt,"date" >= 'date' '2012-01-02 00:00:00' and "date" <= 'date' '2012-01-04 00:00:00'

Thanks!
Tags (2)
0 Kudos
1 Reply
T__WayneWhitley
Frequent Contributor
I think your query for a file gdb needs to be similar to this:
'"date" >= date \'2012-01-02 00:00:00\' and "date" <= date \'2012-01-04 00:00:00\''

So, then this untested snippet:
qry = '"date" >= date \'2012-01-02 00:00:00\' and "date" <= date \'2012-01-04 00:00:00\''
arcpy.TableSelect_analysis(table, nt, qry)
0 Kudos