Display Report Veritally for Horizontal Data
-
Hi All, My database for student installment is like this. ID StudentID Month Year Amount 1 001 4 2009 1000 2 001 5 2009 1000 3 001 6 2009 1000 4 001 7 2009 1000 5 001 8 2009 1000 6 001 9 2009 1000 7 001 10 2009 1000 Now i want the query to display it like StudentID Apr2009 May2009 Jun2009 July2009 001 1000 1000 1000 1000 Any IDEA??? Plz share ur experiences. Thansk Yogesh Agarwal
-
Hi All, My database for student installment is like this. ID StudentID Month Year Amount 1 001 4 2009 1000 2 001 5 2009 1000 3 001 6 2009 1000 4 001 7 2009 1000 5 001 8 2009 1000 6 001 9 2009 1000 7 001 10 2009 1000 Now i want the query to display it like StudentID Apr2009 May2009 Jun2009 July2009 001 1000 1000 1000 1000 Any IDEA??? Plz share ur experiences. Thansk Yogesh Agarwal
If you using Sql Server 2005/8, have a look at the PIVOT command.
-
Hi All, My database for student installment is like this. ID StudentID Month Year Amount 1 001 4 2009 1000 2 001 5 2009 1000 3 001 6 2009 1000 4 001 7 2009 1000 5 001 8 2009 1000 6 001 9 2009 1000 7 001 10 2009 1000 Now i want the query to display it like StudentID Apr2009 May2009 Jun2009 July2009 001 1000 1000 1000 1000 Any IDEA??? Plz share ur experiences. Thansk Yogesh Agarwal
Pivot seems to be a hot topic today, read the thread below this one, take a look at this article. Pivot two or more columns in SQL Server 2005[^]
Never underestimate the power of human stupidity RAH
-
Hi All, My database for student installment is like this. ID StudentID Month Year Amount 1 001 4 2009 1000 2 001 5 2009 1000 3 001 6 2009 1000 4 001 7 2009 1000 5 001 8 2009 1000 6 001 9 2009 1000 7 001 10 2009 1000 Now i want the query to display it like StudentID Apr2009 May2009 Jun2009 July2009 001 1000 1000 1000 1000 Any IDEA??? Plz share ur experiences. Thansk Yogesh Agarwal
Check out the following link PIVOT