Hi,
I'm trying to use the following SQL statment in the "Edit Query Layer" dialog, but it seems to be getting hung-up on the "year" part of the query where I am just looking for rows that have an INSP_DATE year of 2022. I don't think this "year" functionality exists in the query tool, so I am just wondering on an alternative method.
I've tried every SQL trick I can think of, but cannot get this to work.
select GISWRKS1.works.WAT_ControlValve_evw.*
FROM GISWRKS1.works.WAT_ControlValve_evw
WHERE FACILITYID NOT IN (
SELECT FACILITYID FROM GISWRKS1.works.INSPECTIONS_VALVE_INSPECTION
WHERE DATEPART(year, INSP_DATE) = 2022)
This should exclude all valves that had in inspection done in 2022, but it always shows all valves.
Thanks,