Solved Join query to display related records from same table on same row (1 Viewer)

Kayleigh

Member
Local time
Today, 08:56
Joined
Sep 24, 2020
Messages
706
I'm looking for a way to display fields of same table twice in a query, as I have normalised the data so now I wish to present specific fields concisely as one output.
My current table structure is:
tblGuardian (PK fldGuardianID)
jtblStudentGuardian (PK fldStudentGuardianID)
tblStudent (PK fldStudentID)

Assuming that each student has two guardians I would like a query that outputs:
fldStudentID, fldGuardianID_1, fldGuardianID_2 and relevant details
And also query to check if their address/phone details are the same and then output only one.

A more explanatory diagram attached.
 

Attachments

  • student-guardian.png
    student-guardian.png
    63.2 KB · Views: 207

theDBguy

I’m here to help
Staff member
Local time
Today, 01:56
Joined
Oct 29, 2018
Messages
21,358
Hi. I wonder if you could use a Crosstab query for this.
 

Kayleigh

Member
Local time
Today, 08:56
Joined
Sep 24, 2020
Messages
706
Thanks. Worked like a dream!
 

Users who are viewing this thread

Top Bottom