FYI: I'm using SQL Server 2012.
Because scope of the function is a selling date which is different by the days of week (like comparison for customer visiting percentage).
So the main key to compare between last-this year, is to check the same week or same day that most related to the month and are same day (Monday, Tuesday, ...)
2018/11/01 should compare to 2017/11/02 (Thu) 2018/11/02 should compare to 2017/11/03 (Fri) ... 2018/11/30 should compare to 2017/12/01 (Fri)
I can't imagine the syntax out of my head. What is syntax should I write? What are the keywords, functions should I call to achieve this scope?
Anyone who has experience about some kind of function like this, please help. All comments would be appreciate.