Select to view content in your preferred language

Query Date Field for Hosted Layer in ArcGIS Pro

1260
2
03-14-2018 03:45 PM
Jonathanraine1
Emerging Contributor

Is it possible to query for a date range in ArcGIS Pro for a hosted data layer.  It gives me a "ERROR 000358: Invalid expression" when I try to select a date using the select by attributes tool.  What is the correct format to use when querying for dates on hosted data?   I would like to make this query the first step in a task.  Thanks for any help.

2 Replies
AndrewHargreaves2
Deactivated User

I too am completed confused by this. All I'm trying to do is use Pro to "Select by Attributes" as shown in the attached screenshot. However, I'm continually told "There was an error with the expression" despite using the query builder. Things to note:

  • This is hosted Feature Service made using Survey123
  • [Date Operated] is a datefield

Dan Patterson‌, Jake Skinner‌, David Watkins

0 Kudos
RobertMEIER
Regular Contributor

I had to CAST the date string to get it to work like this:

DateSmoke BETWEEN CAST('2018-08-01' AS Date) AND CAST('2018-08-31' AS Date)

or 

DateSmoke > CAST('2018-08-01' AS Date)