Add this line at the beginning of your code
CREATE TABLE #OutPutTBL(TARGETDATE INT, ACTUALDATE INT, PERCENTAGE DECIMAL(10,2),
MONTH INT(100))
At the end modify the SQL like below
SELECT SUM(CONVERT(INT, TargetDate)) AS TargetDate,
SUM(CONVERT(INT, ActualDate)) AS ActualDate,
SUM(CONVERT(INT, CompleteRate))/SUM(CONVERT(INT, TargetDate))
AS CompletePercentage, Months
INTO #OutputTBL
FROM #FORMULA
GROUP BY Months