Markthearm
New Member
- Joined
- Jun 20, 2018
- Messages
- 6
Hi all,
hoping for some help...
I've constructed a student mark book database with the following tables -
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][TABLE="width: 100"]
<tbody>[TR]
[TD]TblStudents[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]TblResults[/TD]
[TD]TblAssessment[/TD]
[/TR]
[TR]
[TD]StudentID[/TD]
[TD]ResultsID[/TD]
[TD]AssessmentID[/TD]
[/TR]
[TR]
[TD]StudentEmail[/TD]
[TD]StudentID[/TD]
[TD]Title[/TD]
[/TR]
[TR]
[TD]StudentName[/TD]
[TD]AssessmentID[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]Tutor[/TD]
[TD]Mark[/TD]
[TD]TotalMarks[/TD]
[/TR]
[TR]
[TD]Gender[/TD]
[TD][/TD]
[TD]Test,Y/N[/TD]
[/TR]
[TR]
[TD]MTG[/TD]
[TD][/TD]
[TD]Year12?[/TD]
[/TR]
[TR]
[TD]Group[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]TutorGroup[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]StudentInactive[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQAASBiologyGrade[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
works great, typical result being:
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD]FrmShowResults[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]StudentName[/TD]
[TD]Title[/TD]
[TD]Mark[/TD]
[/TR]
[TR]
[TD]Doe, John[/TD]
[TD]DNA HW[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]Doe, John[/TD]
[TD]Plant cells[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]Smith, Jane[/TD]
[TD]DNA HW[/TD]
[TD]17[/TD]
[/TR]
[TR]
[TD]Smith, Jayne[/TD]
[TD]Plant cells[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]
However, the head of department has asked me if I can modify the db to show all students / all assessments on the same form, like this -
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD]FrmShowResults[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]StudentName[/TD]
[TD]Title[/TD]
[TD]Mark[/TD]
[TD]Title[/TD]
[TD]Mark[/TD]
[/TR]
[TR]
[TD]Doe, John[/TD]
[TD]DNA HW[/TD]
[TD]19[/TD]
[TD]Plant cells[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]Smith, Jane[/TD]
[TD]DNA HW[/TD]
[TD]17[/TD]
[TD]Plant cells[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]
Racked my brains trying to figure this out. Tried DLookup, but slow and there are over 60 assessments in the db.
Also tried adding copies of TblAssessment in the query builder, which worked, but I would need 60 copies of tblAssessment which would produce, I imagine, a huge SQL statement, with joins to each table. For example, just five copies of the AssessmentID table proudces the following SQL statement:
SELECT [TblResults redesign].StudentID, TblStudents.StudentName, [TblAssessment 1].Title, [TblResults redesign].Mark1, [TblAssessment 2].Title, [TblResults redesign].Mark2, [TblAssessment 3].Title, [TblResults redesign].Mark3, [TblAssessment 4].Title, [TblResults redesign].Mark4, [TblAssessment 5].Title, [TblResults redesign].Mark5
FROM TblStudents INNER JOIN ((((([TblResults redesign] INNER JOIN [TblAssessment 1] ON [TblResults redesign].Assessment1ID = [TblAssessment 1].Assessment1ID) INNER JOIN [TblAssessment 2] ON [TblResults redesign].Assessment2ID = [TblAssessment 2].Assessment2ID) INNER JOIN [TblAssessment 3] ON [TblResults redesign].Assessment3ID = [TblAssessment 3].Assessment3ID) INNER JOIN [TblAssessment 4] ON [TblResults redesign].Assessment4ID = [TblAssessment 4].Assessment4ID) INNER JOIN [TblAssessment 5] ON [TblResults redesign].Assessment5ID = [TblAssessment 5].Assessment5ID) ON TblStudents.StudentID = [TblResults redesign].StudentID
WHERE ((([TblResults redesign].StudentID)=1));
I feel sure there must be an easier way, but my Access/SQL knowledge doesn't stretch that far. I can find my way around VBA, although I am self taught, so a possible coding solution may help.
Thanks for any advice offered, even if it's 'no you can't really do that with a database', in which case I would pursue an Excel solution.
hoping for some help...
I've constructed a student mark book database with the following tables -
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][TABLE="width: 100"]
<tbody>[TR]
[TD]TblStudents[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]TblResults[/TD]
[TD]TblAssessment[/TD]
[/TR]
[TR]
[TD]StudentID[/TD]
[TD]ResultsID[/TD]
[TD]AssessmentID[/TD]
[/TR]
[TR]
[TD]StudentEmail[/TD]
[TD]StudentID[/TD]
[TD]Title[/TD]
[/TR]
[TR]
[TD]StudentName[/TD]
[TD]AssessmentID[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]Tutor[/TD]
[TD]Mark[/TD]
[TD]TotalMarks[/TD]
[/TR]
[TR]
[TD]Gender[/TD]
[TD][/TD]
[TD]Test,Y/N[/TD]
[/TR]
[TR]
[TD]MTG[/TD]
[TD][/TD]
[TD]Year12?[/TD]
[/TR]
[TR]
[TD]Group[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]TutorGroup[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]StudentInactive[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQAASBiologyGrade[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
works great, typical result being:
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD]FrmShowResults[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]StudentName[/TD]
[TD]Title[/TD]
[TD]Mark[/TD]
[/TR]
[TR]
[TD]Doe, John[/TD]
[TD]DNA HW[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]Doe, John[/TD]
[TD]Plant cells[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]Smith, Jane[/TD]
[TD]DNA HW[/TD]
[TD]17[/TD]
[/TR]
[TR]
[TD]Smith, Jayne[/TD]
[TD]Plant cells[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]
However, the head of department has asked me if I can modify the db to show all students / all assessments on the same form, like this -
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD]FrmShowResults[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]StudentName[/TD]
[TD]Title[/TD]
[TD]Mark[/TD]
[TD]Title[/TD]
[TD]Mark[/TD]
[/TR]
[TR]
[TD]Doe, John[/TD]
[TD]DNA HW[/TD]
[TD]19[/TD]
[TD]Plant cells[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]Smith, Jane[/TD]
[TD]DNA HW[/TD]
[TD]17[/TD]
[TD]Plant cells[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]
Racked my brains trying to figure this out. Tried DLookup, but slow and there are over 60 assessments in the db.
Also tried adding copies of TblAssessment in the query builder, which worked, but I would need 60 copies of tblAssessment which would produce, I imagine, a huge SQL statement, with joins to each table. For example, just five copies of the AssessmentID table proudces the following SQL statement:
SELECT [TblResults redesign].StudentID, TblStudents.StudentName, [TblAssessment 1].Title, [TblResults redesign].Mark1, [TblAssessment 2].Title, [TblResults redesign].Mark2, [TblAssessment 3].Title, [TblResults redesign].Mark3, [TblAssessment 4].Title, [TblResults redesign].Mark4, [TblAssessment 5].Title, [TblResults redesign].Mark5
FROM TblStudents INNER JOIN ((((([TblResults redesign] INNER JOIN [TblAssessment 1] ON [TblResults redesign].Assessment1ID = [TblAssessment 1].Assessment1ID) INNER JOIN [TblAssessment 2] ON [TblResults redesign].Assessment2ID = [TblAssessment 2].Assessment2ID) INNER JOIN [TblAssessment 3] ON [TblResults redesign].Assessment3ID = [TblAssessment 3].Assessment3ID) INNER JOIN [TblAssessment 4] ON [TblResults redesign].Assessment4ID = [TblAssessment 4].Assessment4ID) INNER JOIN [TblAssessment 5] ON [TblResults redesign].Assessment5ID = [TblAssessment 5].Assessment5ID) ON TblStudents.StudentID = [TblResults redesign].StudentID
WHERE ((([TblResults redesign].StudentID)=1));
I feel sure there must be an easier way, but my Access/SQL knowledge doesn't stretch that far. I can find my way around VBA, although I am self taught, so a possible coding solution may help.
Thanks for any advice offered, even if it's 'no you can't really do that with a database', in which case I would pursue an Excel solution.