Results 1 to 8 of 8
  1. #1
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167

    Query Design

    Hi,



    I have old student records that cotain Grade, Progress, StudentID and CourseNumber fields which are linked to a table with a CourseName field. I have new student records in the same table (with the same fields) with empty Grade and Course fields. I need to update the new records with the old Grade and progress data based on finding the correct old record containing the same StudentID and CourseName, only updating those where the StudentID and CourseName are the same. I am not sure where to begin with the design of this query. My Critera building skills are still rather weak.

    Tahnks and take care,

    Daryl

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    You indicated that the Grade and Course Fields are empty. Did you mean that both are empty? If so, I don't see how you can match old student name and old course number with new student name and new course number. Or am I missing something here. Are there two fields for the course? Name and Number? Please clarify this issue.

  3. #3
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167
    Thanks for the reply. The old records are from last years enrollment and the new records are from this years enrollment. In our program when a student doesn't finish a course by June they reenroll in the same course the following year under a new CourseNumber (sometimes with a new faculty member assigned to that course). What stays the same is the StudentID and the CourseName. The CourseName (CourseInventoryT) is linked to a table of CourseNumbers (AnnualCourseNumbers) which is linked to the StudentID (in the StudentEnrollmentTable). The fields Grade and Progress are field in the StudentEnrollmentT. They contain last years data (current Grade and Progress (% of course completed)). I need to transfer this data to the Progress and Grade fields of the new records which are currently empty as these records were created with the new CourseNumbers.

    I don`t have the DB at home, other wise I would send some attachments. It seems like it should be doable, I just don`t know the criteria I need to use to match the StudentID and CourseName from last years record to the StudentiD and CourseName of the new records. It is the CourseNumbers of each record that are different.

    Thanks and take care,

    Daryl

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    I was thinking that a self join might work, but that would also give you the old records linking to the old records and the new records linking to the new records so I don't think that will work. It would be helpful to see a dummied up (Remove any confidential or change confidential data) sample database. It may be easier to devolve a solution if we have something to play with.

    Alan

  5. #5
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167

    DB Attached

    Hi Alan,

    Thnaks for looking at this for me!

    Take care,

    Daryl
    Attached Files Attached Files

  6. #6
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    Looking at your db now. Not sure which table you wish to update? also which fields need to be updated and with which data. Please be as specific as possible. Use an example if possible for one student.

    Alan

  7. #7
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167
    Thanks for the reply.

    If you sort StudentEnrollmentT by StudentNumber there will be 8 records with the 0013869 StudentNumber. The corresponding AnnulaClassNumberID will be different for each one. If you look up the AnnualClassNumber in the AnnualClassNumberT, you will see that some of these AnnualClassNumbers are assigned to term 1119 (last year) and some 1229 (this year). It varies, but most of the StudentEnrollmentTable records that correspond to the 1119 TermNumber have data in the Progress and Grade fields but none in the Progress and Grade fields for those records in the StudentEnrollmentT that correspond to the TermNumber 1129.

    If you also look at the AnnualClassNumbersT the CourseInventoryID is linked to one of only 74 records. (Each year the ClassNumber changes as does the TermNumber, but the CourseName remians the same. Students who have no completed a course get re-enrolled into the same course(name) but under a different CourseNumber and TermNumber. The is imposed on us by the college and we get our initial data from a PeopleSoft DB).

    What I am trying to do is transfer the Progress and Grade field's data associated with the Term 1119 ClassNumber to the ClassNumber associated with Term 1129 for the same CourseInvetoryT (Course)ID. If you run the StudentEnrollmentbyFacultyQ it will return all the students assigned to that Faculty for this year (Term 1229). I need to have it display the Progress and Grade data with these records from the same course for the student from the previous year. A course they have yet to finish.

    Once again Thanks. Please ask more questions if you need more info.

    Take care,

    Daryl

  8. #8
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167
    Hi,

    I managed to figure it out.

    Take care,

    Daryl

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Table Design -- want to avoid a design that creates blank fields
    By snowboarder234 in forum Database Design
    Replies: 4
    Last Post: 10-08-2012, 10:13 AM
  2. Query design help
    By claudia_lovez_u in forum Access
    Replies: 9
    Last Post: 04-19-2012, 07:33 PM
  3. Query - Design View
    By Rick West in forum Queries
    Replies: 4
    Last Post: 04-09-2012, 04:09 PM
  4. Web database design query
    By jfn15 in forum Database Design
    Replies: 0
    Last Post: 03-28-2012, 07:39 PM
  5. Table design or query or?
    By Laaacux in forum Database Design
    Replies: 5
    Last Post: 02-22-2011, 02:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums