Select to view content in your preferred language

Filter based on sql Right expression

319
2
Jump to solution
07-31-2024 01:39 AM
KARIMLABIDI
Frequent Contributor

Hello,

I'm trying to filter my layer to create a featureSet with a right but dashboard sends me a error . 

My goal is to keep the features who have the same date as the actual year. I use the field DEVIATION and I hoped with a right do the query.

KARIMLABIDI_0-1722414785170.png

Here's my code

KARIMLABIDI_1-1722414894717.png

I've seen on esri documentation https://doc.arcgis.com/fr/drone2map/2023.1/help/sql-reference-for-elements-used-in-query-expressions... and my code seems good but it's doesn't work.

Thank you for your help!

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

The SQL functions in that page are not comprehensive. A lot depends on the underlying RDBMS, and there are many functions not on that list you can use, others on that list that don't always seem to work.

If you're trying to filter by year, and the year is always at the end of the string, try this:

var sizeFilter = `DEVIATION LIKE '%${Year(Now())}'`
- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Esteemed Contributor

The SQL functions in that page are not comprehensive. A lot depends on the underlying RDBMS, and there are many functions not on that list you can use, others on that list that don't always seem to work.

If you're trying to filter by year, and the year is always at the end of the string, try this:

var sizeFilter = `DEVIATION LIKE '%${Year(Now())}'`
- Josh Carlson
Kendall County GIS
KARIMLABIDI
Frequent Contributor

Thank you it works!!!

0 Kudos