AnsweredAssumed Answered

Python API query string

Question asked by granthay on Nov 11, 2019
Latest reply on Nov 11, 2019 by jrmatchett

I'm trying to use the Python API in a regularly scheduled script to query data from a table, I'd like to query the weeks data for processing. I can query any non date field just fine, but whenever I try to query a date field I get either a 'where' parameter invalid or "Unable to perform query. Please check your parameters." Below is the code, I have also tried numerous different date formats, but to no avail.

 

timeDifference = datetime.datetime.now() - datetime.timedelta(days = 7)
queryString1 = 'Survey_Start>' + str(timeDifference)
query1Result = table.query(where=queryString1, out_fields='Project')

Outcomes