G
Guest
Greetings.
I have a database with the following tables:
tblOrg
=====
OrgID (*)
OrgName
tblRep
=======
RepID (*)
OrgID (FK)
RepName
tblProject
========
ProjectID (*)
ProjectName
tblProjectPartner (with the combination of ProjectID and RepID as PK)
============
ProjectID (*)
RepID (*)
tblOrg (1) -----> (many) tblOrgRep
---------------------------------------
I need to get a query that lists the Organizations and the Projects, linked
using RepID. I need the pair of OrgID, ProjectID to be unique, and am having
trouble figuring this out. e.g.
===============
tblOrg
===============
OrgID -- OrgName
--------------------
1 -- Org_A
2 -- Org_B
3 -- Org_C
=====================
tblRep
=====================
RepID -- RepName -- OrgID
-----------------------------
1 -- Joe -- 1
2 -- Jane -- 1
3 -- Jack -- 1
4 -- Smith -- 2
5 -- Mel -- 2
6 -- Zack -- 3
====================
tblProject
====================
ProjectID -- ProjectName
---------------------------
1 -- ProjectThis
2 -- ProjectThat
================
tblProjectPartner
================
ProjectID -- RepID
---------------------
1 -- 1
1 -- 2
1 -- 4
1 -- 5
2 -- 1
2 -- 3
2 -- 4
2 -- 5
2 -- 6
I'd like to run a query to get the following results:
------------------------------------------------
OrgName -- ProjectName
--------------------------
Org_A -- ProjectThis
Org_B -- ProjectThis
Org_A -- ProjectThat
Org_B -- ProjectThat
Org_C -- ProjectThat
=> a list of unique Organizations partnerting on each Project.
I've been able to link tables and run a query that lists the Projects and
Organizations, but I've been unable to get the unique pair (Org, Project) in
it. Can this be done without making a table? How?
Thanks for any pointers/help.
-Amit
I have a database with the following tables:
tblOrg
=====
OrgID (*)
OrgName
tblRep
=======
RepID (*)
OrgID (FK)
RepName
tblProject
========
ProjectID (*)
ProjectName
tblProjectPartner (with the combination of ProjectID and RepID as PK)
============
ProjectID (*)
RepID (*)
tblOrg (1) -----> (many) tblOrgRep
---------------------------------------
I need to get a query that lists the Organizations and the Projects, linked
using RepID. I need the pair of OrgID, ProjectID to be unique, and am having
trouble figuring this out. e.g.
===============
tblOrg
===============
OrgID -- OrgName
--------------------
1 -- Org_A
2 -- Org_B
3 -- Org_C
=====================
tblRep
=====================
RepID -- RepName -- OrgID
-----------------------------
1 -- Joe -- 1
2 -- Jane -- 1
3 -- Jack -- 1
4 -- Smith -- 2
5 -- Mel -- 2
6 -- Zack -- 3
====================
tblProject
====================
ProjectID -- ProjectName
---------------------------
1 -- ProjectThis
2 -- ProjectThat
================
tblProjectPartner
================
ProjectID -- RepID
---------------------
1 -- 1
1 -- 2
1 -- 4
1 -- 5
2 -- 1
2 -- 3
2 -- 4
2 -- 5
2 -- 6
I'd like to run a query to get the following results:
------------------------------------------------
OrgName -- ProjectName
--------------------------
Org_A -- ProjectThis
Org_B -- ProjectThis
Org_A -- ProjectThat
Org_B -- ProjectThat
Org_C -- ProjectThat
=> a list of unique Organizations partnerting on each Project.
I've been able to link tables and run a query that lists the Projects and
Organizations, but I've been unable to get the unique pair (Org, Project) in
it. Can this be done without making a table? How?
Thanks for any pointers/help.
-Amit