Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

SQL PIVOT with Matrix

$
0
0

Hi - I would like to create a SSRS Matrix report. I have some SQL (see below) and understand I may need to update it using TSQL Pivot to allow me to create a SSRS matrix that would give me the following layout - can anyone help?

Sample data and SSRS report requirement:

Current SQL:

select   p.ProjectName  
         , ta.Billable 
         , ta.NonBillable
         , ta.Overtime
         , DATEPART(year,ta.TimeByDay) as [Year]
         , DATEPART(month,ta.TimeByDay) as [Month]
from dbo.tov ta
inner join dbo.tuv tl
 on ta.id = tl.id
inner join dbo.eru r
 on r.id = tl.id
left outer join dbo.epu p
 on p.id = tl.id
left outer join dbo.etu t
 on t.id = tl.id  
where DATEPART(year,ta.TimeByDay) = '2013' 
and DATEPART(month,ta.TimeByDay) = '1'


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>