Help with update query

G

Guest

I have a primary table with student names and an autoNumber Student ID.
In another table (Attendance) I have the names of students and want to
assign the correct StudentID to the LastName in the Attendance table. Help?
 
T

tina

the first question is: why? if you have a tblStudents, where all students
are listed, and a tblAttendance, where presumably you track (daily? weekly?)
attendance for specific students, then it sounds like those table have a
one-to-many relationship - one student may have many attendance records, but
each attendance record belongs to only one student. tblAttendance should
have only a foreign key field that contains the primary key values from
tblStudents, that identify which student record is linked to each attendance
record.

if the data in tblAttendance comes from "outside" the database, outside of
your control, and all you have are last names to work with, then you can use
a Select query to link the student records to the attendance records by last
name, and then turn the Select query into an Update query. but you're going
to have problems with that if more that one student in tblAttendance happen
to have the same last name; there's no easy way to deal with that, unless
there are other identifying data in tblAttendance that you can match with
identifying data in tblStudents.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top