Further integration of YEAR_WITHIN into SGP functions