The error message, "There was an error with expression" is returned when validating a definition query on a date field of a hosted feature layer in ArcGIS Pro 2.2.
This bug is addressed in the current development build of ArcGIS Pro.
解决办法
Create a Web Feature Service (WFS) of the hosted feature layer and query the (WFS).Please note:
If there are records more than 3000 in the hosted feature layer, add the (WFS) in Contents Pane > double-click the (WFS) layer> (WFS)> Set Maximum Features returned to the number of records the layer has.
If the feature class or shapefile used to create hosted feature layer is in Geographic Coordinate System (GCS), the features present in the (WFS) cannot be viewed. Thus, make sure that the data is in Projected Coordinate System (PCS).