Select to view content in your preferred language

ArcGIS Enterprise Query widgets fails on datefield from a view

384
1
10-28-2024 05:12 AM
LarsMagnusson
Emerging Contributor

ArcGIS Enterprise 11.1

When querying a date-field in a view I get an error and in ArcGIS server log I get the same error as this:

https://support.esri.com/en-us/knowledge-base/rest-query-on-the-date-field-no-longer-works-after-upg...

I've tested the parameter change explained in the above link and it works if I do that. However that is a security issue and I'd rather not do that in an environment that's available online.

The error in ArcGIS Server log:
An invalid where clause or definition expression has been requested: "inflyttningsdatum >= '2024-10-02 22:00:00' AND inflyttningsdatum < '2024-10-31 23:00:00'"
When testing in the rest-interface query it works if I add DATE before the date as in DATE '2024-10-02 22:00:00'

The view is located in an SQLSERVER sde-database and the view is registered with the database. The view reads data from another SQLSERVER database(not sde). The original data is in a STRING-field on the format YYYYMMDD. In the view I cast this data to a DATE-field (cast(inflyttdat as date) as inflyttningsdatum). I've also tried a casting to a datetime2-field.

Should the query widget be able to query date-fields in views? Is the way I have created the view(with a cast) not supported?

1 Reply
KirkWebb
Occasional Contributor

Thank you!  This worked great for me!

0 Kudos