A
AccessNewbie
I have a database with a couple of table. The main table I am working with
(named PR) has one field for the project manager's id number ("projmgr") and
one field for the project supervisor's id number ("supervisor").
The name of the project manager and supervisor are in a second table (named
EM). This table has fields for first name ("firstname"), last name
("lastname"), middle name ("middlename") and id number ("employee").
I would like to do one SELECT statement that will return, among other things
the names of both the project manager and supervisor.
So far I have the following SELECT statement:
SELECT pr.wbs1, pr.wbs2, pr.wbs3, pr.longname, pr.projmgr,
pr.supervisor, pr.clientid, pr.fee, pr.reimballow, pr.consultfee,
pr.org, projectcustomtabfields.custhpprojectno as HPNum,
em.lastname, em.firstname, em.middlename, cl.name as ClientName,
organization.name as OfficeName FROM pr
LEFT JOIN projectcustomtabfields on (pr.wbs1=projectcustomtabfields.wbs1
and pr.wbs2=projectcustomtabfields.wbs2 and
pr.wbs3=projectcustomtabfields.wbs3)
LEFT JOIN organization on pr.org= organization.org
LEFT JOIN em on pr.projmgr=em.employee
LEFT JOIN cl on pr.clientid=cl.clientid
WHERE pr.status='A' and pr.org='6501'
ORDER BY pr.wbs1, pr.wbs2, pr.wbs3
This only returns the name of the project manager. How can I also get the
name of the supervisor?
thanks
(named PR) has one field for the project manager's id number ("projmgr") and
one field for the project supervisor's id number ("supervisor").
The name of the project manager and supervisor are in a second table (named
EM). This table has fields for first name ("firstname"), last name
("lastname"), middle name ("middlename") and id number ("employee").
I would like to do one SELECT statement that will return, among other things
the names of both the project manager and supervisor.
So far I have the following SELECT statement:
SELECT pr.wbs1, pr.wbs2, pr.wbs3, pr.longname, pr.projmgr,
pr.supervisor, pr.clientid, pr.fee, pr.reimballow, pr.consultfee,
pr.org, projectcustomtabfields.custhpprojectno as HPNum,
em.lastname, em.firstname, em.middlename, cl.name as ClientName,
organization.name as OfficeName FROM pr
LEFT JOIN projectcustomtabfields on (pr.wbs1=projectcustomtabfields.wbs1
and pr.wbs2=projectcustomtabfields.wbs2 and
pr.wbs3=projectcustomtabfields.wbs3)
LEFT JOIN organization on pr.org= organization.org
LEFT JOIN em on pr.projmgr=em.employee
LEFT JOIN cl on pr.clientid=cl.clientid
WHERE pr.status='A' and pr.org='6501'
ORDER BY pr.wbs1, pr.wbs2, pr.wbs3
This only returns the name of the project manager. How can I also get the
name of the supervisor?
thanks