Until last week, I was regularly querying this MapServer with a URL that specified minimum date. Sometime last week, I started getting error code 400.
My now-failing URL looks like this: https://dhsgis.wi.gov/server/rest/services/DHS_COVID19/COVID19_WI_V2/MapServer/11/query?where=RptDt>='2022-05-01'&outFields=*&returnGeometry=false&outSR=4326&f=json
The key bit is where=RptDt>='2022-05-01'.
This URL, without the date argument, works just fine, so this isn't an issue with the server itself.
https://dhsgis.wi.gov/server/rest/services/DHS_COVID19/COVID19_WI_V2/MapServer/11/query?where=1%3D1&outFields=*&returnGeometry=false&outSR=4326&f=json
Did ArcGIS change the formatting for date values? Does anyone know how I can update my URL to work properly?
Solved! Go to Solution.
Try using something like timestamp '2022-05-01'. We encountered this with a server upgrade in the past, where the word "timestamp" was previously not required, which broke some of our queries.
Try using something like timestamp '2022-05-01'. We encountered this with a server upgrade in the past, where the word "timestamp" was previously not required, which broke some of our queries.
Bingo. This works:
https://dhsgis.wi.gov/server/rest/services/DHS_COVID19/COVID19_WI_V2/MapServer/11/query?where=RptDt>=timestamp'2022-05-01'&outFields=*&returnGeometry=false&outSR=4326&f=json
Thanks, Josh!