J
Joy M
HI -
This database keeps track of firefighters who are taking courses at a
training school. I will give you a 'bare bones' description of the
situation and my problem.
The question I have concerns the department table, i.e. the fire department
name table. The department table looks like this:
DepartmentID
DepartmentName
The student table contains firefighter names and home departments. It looks
something like this:
StudentID
FirstName
LastName
HomeDepartment (foreign key to department table). The home department is a
lookup field.
There is also a student course registration table, where students enroll in
courses. The course can be paid for by a sponsoring department.
For example, firefighter X has department A as his home department, but
department F pays for this course. So department F goes on the student's
course certificate (which he receives when he completes the course).
The student course registration table looks something like this
StudentID
CourseID
Fees
Attendance
Mark
SponsoringDepartment (foreign key to department table)
My problem is when I print the student course certificates.. .I want to have
the student name and the sponsoring department name (not the ID) on the
certificate.
I don't know if this is possible because my query uses information from the
student table, the student course registration table and the department
table.
If I use SponsoringDepartment on the report, I only get the DepartmentID,
not the DepartmentName. I don't see how I can use the DepartmentName
because it is in a loop - on one hand it contains the DepartmentName of the
HomeDepartment, in the other it contains the DepartmentName of the
SponsoringDepartment.
Some ideas:
1 Duplicating the department table - but that creates a maintenance problem
2 Instead of storing the DepartmentID in HomeDepartment and
SponsoringDepartment, store the DepartmentName itself, which is considerably
longer. But then I would have it for the certificate.
I hope someone can give me some guidance. I am looking forward to hearing
your thoughts.
Thanks!
Joy
This database keeps track of firefighters who are taking courses at a
training school. I will give you a 'bare bones' description of the
situation and my problem.
The question I have concerns the department table, i.e. the fire department
name table. The department table looks like this:
DepartmentID
DepartmentName
The student table contains firefighter names and home departments. It looks
something like this:
StudentID
FirstName
LastName
HomeDepartment (foreign key to department table). The home department is a
lookup field.
There is also a student course registration table, where students enroll in
courses. The course can be paid for by a sponsoring department.
For example, firefighter X has department A as his home department, but
department F pays for this course. So department F goes on the student's
course certificate (which he receives when he completes the course).
The student course registration table looks something like this
StudentID
CourseID
Fees
Attendance
Mark
SponsoringDepartment (foreign key to department table)
My problem is when I print the student course certificates.. .I want to have
the student name and the sponsoring department name (not the ID) on the
certificate.
I don't know if this is possible because my query uses information from the
student table, the student course registration table and the department
table.
If I use SponsoringDepartment on the report, I only get the DepartmentID,
not the DepartmentName. I don't see how I can use the DepartmentName
because it is in a loop - on one hand it contains the DepartmentName of the
HomeDepartment, in the other it contains the DepartmentName of the
SponsoringDepartment.
Some ideas:
1 Duplicating the department table - but that creates a maintenance problem
2 Instead of storing the DepartmentID in HomeDepartment and
SponsoringDepartment, store the DepartmentName itself, which is considerably
longer. But then I would have it for the certificate.
I hope someone can give me some guidance. I am looking forward to hearing
your thoughts.
Thanks!
Joy