I have a table that has a primary key consisting of three fields:
Buildingid
Year
Subjectid
The other fields in this table record the number of teachers in the grade and students enrolled.
Example
Buildingid year subjectid countteachers enrollstudents
1 2008 12 5 100
1 2007 12 6 125
Here is my problem. I need to produce a report that shows the increase or decrease in countteachers and enrollstudents from one year to another. The structure of the report requested is as follows:
The report would be grouped by building
Staffing
Subject id 2007 teacher 2007 enrollment 2008 teachers 2008 enrollment +/- teachers +/- students
I can’t envision how to do this unless all this data is available in one record. I have thought about writing some code that would create a temp table that could loop through a recordset and and basically create a table they way I need it. Any ideas would be most appreciated.
Buildingid
Year
Subjectid
The other fields in this table record the number of teachers in the grade and students enrolled.
Example
Buildingid year subjectid countteachers enrollstudents
1 2008 12 5 100
1 2007 12 6 125
Here is my problem. I need to produce a report that shows the increase or decrease in countteachers and enrollstudents from one year to another. The structure of the report requested is as follows:
The report would be grouped by building
Staffing
Subject id 2007 teacher 2007 enrollment 2008 teachers 2008 enrollment +/- teachers +/- students
I can’t envision how to do this unless all this data is available in one record. I have thought about writing some code that would create a temp table that could loop through a recordset and and basically create a table they way I need it. Any ideas would be most appreciated.
Comment