I have a date field being used in a filter pane. The format is YYYYMM. Currently, the field contains dates from 194701 to 204601, but I need to limit those values to whatever the current date is and back 10 years only.
For example, if todays date is 202302, then I need the values in the date field to only show 10 years worth of dates. In this case, 201302 - 202302. A rolling 10 year span.
I've tried putting the conditions in the where clause of my query, such as:
WHERE YEAR(LEFT(YR_MO_NR, 4)) >= (YEAR(CURRENT_DATE) - 10) AND YEAR(LEFT(YR_MO_NR, 4)) < = YEAR(CURRENT_DATE)
No luck.
Any ideas?