Last active
December 17, 2015 20:29
-
-
Save kristinaconley/5667772 to your computer and use it in GitHub Desktop.
This file contains 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
BEGIN | |
INSERT INTO @Projected (timeframe, Successes, Contacts) | |
(SELECT | |
P.timeframe | |
,SUM(Successes) AS 'Successes' | |
,SUM(Contacts) AS 'Contact' | |
FROM CalculatedData C | |
RIGHT JOIN @Projected P ON (P.timeframe = datediff(dd,AddedDate,GETDATE())) | |
GROUP BY p.timeframe, datediff(dd,AddedDate,GETDATE()) | |
) | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment