Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
DECLARE @ACCOUNT VARCHAR(10) DECLARE @YEAR VARCHAR(4) DECLARE @PERIOD VARCHAR SET @ACCOUNT = '90229' SET @YEAR = '2013' SET @PERIOD = '3' SELECT A.ACCOUNT, A.YEAR, A.PERIOD, A.BALANCE, (A.BALANCE + B.BALANCE) YTD_BALANCE FROM BALANCE A LEFT OUTER JOIN ( SELECT A.ACCOUNT, A.YEAR, A.PERIOD, SUM(A.BALANCE) BALANCE FROM BALANCE A WHERE A.ACCOUNT = @ACCOUNT AND A.YEAR = @YEAR AND A.PERIOD = @PERIOD ) B ON B.ACCOUNT = A.ACCOUNT AND B.YEAR = A.YEAR AND B.PERIOD = (A.PERIOD - 1) WHERE A.ACCOUNT = @ACCOUNT AND A.YEAR = @YEAR AND A.PERIOD = @PERIOD
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.