Hi,
I have two tables named as tblStudents and tblStudentClass and their structure is as below:
tblStudents:
StudentID (PK)
StudentName
tblStudentClass:
RecordID
StudentID (FK)
ClassID (FK; from another table)
DateOfAdmission
DischargeDate
tblStudentClass can have multiple records for a single StudentID each record for registering the student in a class and then its discharge date. I want to create a query which which gives me following fields and a single record for single student:
StudentID
FirstClassAttended
LastClassAttended
I have VBA code for GetFirstClass and GetLastClass which use query to use TOP 1 record of records sorted in ASC and DSC order by DateOfAdmission but using VBA makes the loading very slow. Is it possible to do the same by queries/subqueries?
Best Regards
I have two tables named as tblStudents and tblStudentClass and their structure is as below:
tblStudents:
StudentID (PK)
StudentName
tblStudentClass:
RecordID
StudentID (FK)
ClassID (FK; from another table)
DateOfAdmission
DischargeDate
tblStudentClass can have multiple records for a single StudentID each record for registering the student in a class and then its discharge date. I want to create a query which which gives me following fields and a single record for single student:
StudentID
FirstClassAttended
LastClassAttended
I have VBA code for GetFirstClass and GetLastClass which use query to use TOP 1 record of records sorted in ASC and DSC order by DateOfAdmission but using VBA makes the loading very slow. Is it possible to do the same by queries/subqueries?
Best Regards