Created
January 15, 2015 18:53
-
-
Save nZac/4b8523e543b5e3077a15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create a list of dates incremented by month | |
DECLARE @MinDate DATE = '20120101', | |
@MaxDate DATE = '20150101'; | |
SELECT TOP (DATEDIFF(MONTH, @MinDate, @MaxDate) + 1) | |
full_date = DATEADD(MONTH, ROW_NUMBER() OVER(ORDER BY a.object_id) - 1, @MinDate) | |
FROM sys.all_objects a | |
CROSS JOIN sys.all_objects b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment