Based on my understanding of your problem, the best approach would be to create an island calender table. Then you should link your queries to it. There are many examples in the the community in how to do this.
For e.g. :
Create a variable for your date fields:
vYear - concat it to your Master Calender.
Hope it helps!