It would help if you told us why DDDD, FFFF and JJJJ will be excluded from the output. Is it because of their dates being in November and not December?
What is the source? Could the filter be applied at input?
Can you just not filter the data and exclude records based on the chosen criteria?
Will this criteria change on a regular basis?
I'm sorry but there are more questions than answers.
Expecting a positive reply.