Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.
DECLARE @MAXMONTHS INT SELECT @MAXMONTHS = MAX(DATEDIFF(MM,STARTDATE,ENDDATE)) + 1 FROM [Stage].[RESULTS] -- ADD 1 IN ORDER TO ACCOUNT FOR ROUNDING DOWN IN YEAR CALCULATION DECLARE @THISMONTH INT SET @THISMONTH = 1 WHILE (@THISMONTH <= @MAXMONTHS) BEGIN INSERT INTO [Stage].[TPHASES] SELECT R.SF_ID , R.AP_ID , @THISMONTH AS Phase , DATEADD(MM,@THISMONTH-1,R.STARTDATE) AS STARTDATE , DATEADD(D,-1,DATEADD(MM,@THISMONTH,R.STARTDATE)) AS ENDDATE FROM [Stage].[RESULTS] AS R INNER JOIN [Stage].[RESULTSWO] AS RWO ON RWO.SF_ID = R.SF_ID AND RWO.[ROW] = 1 WHERE R.[ROW] = 1 AND RWO.ENDDATE >= DATEADD(MM,@THISMONTH-1,R.STARTDATE) ORDER BY R.SF_ID SET @THISMONTH = @THISMONTH + 1 END ;
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.