You are on page 1of 1

Query1: select convert(varchar, b.date, 106) as Registration Date, a.ProductDesc as Product Description from table1 a join table2 b on table1.pid=table2.

pid groupby b.date,a.productdesc

Query2: select a.ProductDesc as Product,b.jan 2009, b.feb 2009, b.mar 2009, b.apr 2009, b.may 2009, b.jun 2009, b.july 2009, b.aug 2009, b.sep 2009, b.oct 2009, b.nov 2 009, b.dec 2009 from table1 a join table2 b on table1.pid=table2.pid Pivot ( Sum(PID) for b.Date in (b.jan 2009, b.feb 2009, b.mar 2009, b.apr 2009, b.may 2009, b.jun 2009, b.july 2009, b.aug 2009, b.sep 2009, b.oct 2009, b.nov 2009, b.dec 2009) as PivotTable

You might also like