I rather stumped as it has been several years since I have worked with databases. It's usually easy stuff that hurts and I'm hoping someone can help.
I have a table with student names, there is a table with the names of my parents (both mother and father). I have another table that defines my relationship as mother and father, except for another table which defines all the primary keys and their relationship, I have reached that point where I remembered How to join, but only one time can join a record. I currently have a query in Access 2010 which prints two lines as follows:
Student1 name | Parent's name Parents cell student 1 name | Parent's name Parent 2 cell student name 2 Parent's name Parent1 cell etc. ... I want to complete the following:
Student1 name | Parent's name Parent's name Parents cell Parent 2 cell student name 2 Parent's name Parent's name Parents cell Parent2 cell etc. ... My SQL statement looks like:
Select Student.FirstName, StudentToPersonMap.RelationshipType, Person.FirstName, Person.CellPhone, students involved in the jOIN (individual interiors where both Student.StudentID = on Person.PersonID = StudentToPersonMap.PersonID) on StudentToPersonMap StudentToPersonMap.StudentID (((StudentToPersonMap.RelationshipType) = 1 or (StudentToPersonMap.RelationshipType) = 2) ); Any suggestions will be most welcome either through an access query or through the SQL query! Thanks for reading!
You can use sub quires. Here is an example of the system based on a SQL server, but you can use the same principle in its application
tblProcedures.Procedure_ID, Procedure_name, tReviewer_1.Proc_reviewer_name, tReviewer_2.Proc_reviewer_name selection included within tblProcedures travelers (Procedure_ID, Proc_reviewer_name where tblProc_reviews_req.Proc_reviewer_ID = tblProc_reviewers.Proc_reviewer_ID to choose tblProc_reviewers interiors include tblProc_reviewers.Proc_reviewer_ID = tblProc_reviews_req are 1) as join tReviewer_1.Procedure_ID = tblProcedures.Procedure_ID insider on tReviewer_1 (Procedure_ID, Proc_reviewer_name Selection tblProc_reviewers indoor Join tblProc_reviews_req at tblProc_reviews_req from Ni. Proc_reviewer_ID = tblProc_reviewers.Proc_reviewer_ID WHERE tblProc_reviewers.Proc_reviewer_ID = 2) as tReviewer_1.Procedure_ID = tblProcedures.Procedure_ID on tReviewer_2 make you better two quotes Those who have a query called qryStudent_mothers_details and qryStudent_fathers_detail.
You can join this in your students table and go from there.
Comments
Post a Comment