Adding months that are not in data because no changes in that month

You need a query with all of your month-end dates even if there is business data to report for a given month. This seems similar to this question…

Do you have a calendar table? If not a query (SQL Server syntax) like this will work…

I would prefer to put the code here as text, but I cannot seem to make the formatting work such that when you copy it the quotes and comments are not messed up. You can get the query text from here.

Now you can merge month-end dates from this query with the date in your query.