Hello I am trying create a series of views to show details of staff and their linemanagers,yet can not get them to work. Details of Staff records are in 2 files (Staff1,Staff2), They are linked via fieldname 'PersonKey' and Staff2 contains a field 'PersonKeyMainline' which is the personkey for the linemanager. I am trying to pull out details for both the Staff member and the line manager.
this is my attempt...
SELECT
Staff1.FirstName,
Staff1.Surname,
Staff2.PersonKey,
Staff2.Address1,
Staff2.Address2,
Staff2.Address3,
Staff2.Postcode,
Staff2.PersonKeyMainline
From Staff2 Child2,staff1 Child,Staff1 Parent,Staff2 Parent2
Where Child.PersonKey = Child2.PersonKey AND Child2.PersonKeyMainline = Parent2.PersonKeyMainline and Parent.PersonKeyMainline = Parent.Personkey
I cannot get this to work. I have only just started to learn SQL so have probably made some fundamental errors.
Thankyou in advance.
David Ison
this is my attempt...
SELECT
Staff1.FirstName,
Staff1.Surname,
Staff2.PersonKey,
Staff2.Address1,
Staff2.Address2,
Staff2.Address3,
Staff2.Postcode,
Staff2.PersonKeyMainline
From Staff2 Child2,staff1 Child,Staff1 Parent,Staff2 Parent2
Where Child.PersonKey = Child2.PersonKey AND Child2.PersonKeyMainline = Parent2.PersonKeyMainline and Parent.PersonKeyMainline = Parent.Personkey
I cannot get this to work. I have only just started to learn SQL so have probably made some fundamental errors.
Thankyou in advance.
David Ison