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.
Solved! Go to Solution.
I figured it out, the query string needs the dates in a very specific format, thanks for helping out.
And if you use .format() ?
You don't have to str objects prior to using python 'format' or f strings
"{} - {} = {} ".format(2, 1, 2-1)
'2 - 1 = 1 '
It still fails
message
'where' parameter is invalid
What happens if you print out queryString1, maybe it doesn't fit to Survey_Start field?
Is this helpful?
I figured it out, the query string needs the dates in a very specific format, thanks for helping out.
Here's a useful post on the various date/time query formats for feature services: Querying Feature Services: Date-Time Queries