Monday, January 27, 2014

how to create YTD and MTD reports using Sql Server 2008 r2 report builder 3.0

You can use a correlated subquery to calculate YTD in query behind. You can use APPLY operator for that


so something like



SELECT *
FROM Table t1
CROSS APPLY (SELECT SUM(ProdA) AS TotA,SM(prodB) AS TotB,SUM(prodC) AS TotC
FROM Table
WHERE Year = t.Year)t1



And show TotA,TotB and TotC in the required total row


Another method is to add required totals in SSRS by clicking on relevant group and choosing Add Total option




Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


No comments:

Post a Comment