How do I handle inspections done in the same month?

286
1
Jump to solution
06-10-2022 12:24 PM
neomapper
Occasional Contributor

How do I return a (Yes / No) answer to Results when New_Inspection_Date is in the same month as Last_Inspection_Date?

neomapper_0-1654888778652.png

 

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

Do you mean same calendar month, or within a month of each other?

If the former, you could try:

if(format-date(${Last_Inspected_Date},'%y%m')=format-date(${New_Inspected_Date},'%y%m'), 'Yes', 'No')

Formatting each date as %y%m would reduce them down to the year and month, so two inspections in June 2022 will return a 'Yes', but June 2021 and June 2022 will not. 

- Josh Carlson
Kendall County GIS

View solution in original post

1 Reply
jcarlson
MVP Esteemed Contributor

Do you mean same calendar month, or within a month of each other?

If the former, you could try:

if(format-date(${Last_Inspected_Date},'%y%m')=format-date(${New_Inspected_Date},'%y%m'), 'Yes', 'No')

Formatting each date as %y%m would reduce them down to the year and month, so two inspections in June 2022 will return a 'Yes', but June 2021 and June 2022 will not. 

- Josh Carlson
Kendall County GIS