Select to view content in your preferred language

Definition Query with Multiple Date Fields

157
2
3 weeks ago
MeleKoneya
Frequent Contributor

Hello,

I have three fields which contains dates in a SQL Geodatabase Feature Class.

I want to create a definition query that evaluates the three fields and gets the records who have not been treated within the last six months using each of the fields to to determine the max value.    I would do a CASE statement but that is not possible in Pro from what I am seeing.    Any suggestions?

Thank you,

Mele 

0 Kudos
2 Replies
ChrisUnderwood
Esri Contributor

Hello @MeleKoneya  it's not quite clear how you want to combine your dates information, but if you want to select the records where all of the dates are older than 6 months, then an AND should be sufficient.

SELECT WHERE DATE1>6 MONTHS AGO  AND DATE2>6 MONTHS AGO

0 Kudos
MeleKoneya
Frequent Contributor

Thank you Chris.     I need to get the max of three data fields and create a definition query to limit the records.  I tried using the AND but it doesn't return any records because the values in the date fields are different.   One other caveat is that this is a Feature Class that will be edited.    If it weren't,  I'd probably create a query layer and use CASE in it, but CASE can't be used in a definition query from what I am seeing. 

0 Kudos