G
Guest
Hi,
I'm having trouble designing a query. The set-up is as follows:
[* = PK]
tblOrg (OrgID*, OrgName)
tblProg (ProgID*, ProgName)
tblOrgProg(OrgID*, ProgID*)
I'd like to select one or more ProgIDs (using a multi-select list on a form)
and then display the OrgIDs from tblOrgProg that have a count = (number of
ProgIDs selected) and pair with the selected ProgID(s) only.
e.g.
tblOrgProg
=========
OrgID, ProgID
---------------
1, A
2, A
3, A
1, B
2, B
3, B
1, C
2, C
4, C
If I select (A, B, C) then the query returns (1, 2)
If I select (A, B) then the query returns (3)
If I select (C), then the query returns (4)
This is a follow-up of the question I asked a while ago:
http://support.microsoft.com/newsgr...68b4a85fb9f7&lang=en&cr=US&sloc=en-us&m=1&p=1
and I've tried modifying the query that Van provided, but without the
expected result. I tried it for 2 ProgIDs by having 2 parameters, Prog1 and
Prog2, and changing the count to count(*) = 2, and adding an AND clause to
the WHERE part to check if the ProgID matches Prog1 or Prog2.
Will appreciate any help on this.
Thanks.
-Amit
I'm having trouble designing a query. The set-up is as follows:
[* = PK]
tblOrg (OrgID*, OrgName)
tblProg (ProgID*, ProgName)
tblOrgProg(OrgID*, ProgID*)
I'd like to select one or more ProgIDs (using a multi-select list on a form)
and then display the OrgIDs from tblOrgProg that have a count = (number of
ProgIDs selected) and pair with the selected ProgID(s) only.
e.g.
tblOrgProg
=========
OrgID, ProgID
---------------
1, A
2, A
3, A
1, B
2, B
3, B
1, C
2, C
4, C
If I select (A, B, C) then the query returns (1, 2)
If I select (A, B) then the query returns (3)
If I select (C), then the query returns (4)
This is a follow-up of the question I asked a while ago:
http://support.microsoft.com/newsgr...68b4a85fb9f7&lang=en&cr=US&sloc=en-us&m=1&p=1
and I've tried modifying the query that Van provided, but without the
expected result. I tried it for 2 ProgIDs by having 2 parameters, Prog1 and
Prog2, and changing the count to count(*) = 2, and adding an AND clause to
the WHERE part to check if the ProgID matches Prog1 or Prog2.
Will appreciate any help on this.
Thanks.
-Amit