|
-
SQL Help
I have three tables with their following attributes:
INVOICE - rowstamp, ponumber, activitynumber, invoiceno
PO - ponumber, postart, poend
ACTIVITY - code
PO, which has a list of Purchase Order Numbers; ACTIVITY, which has a list of Activities, and INVOICE, which matches activities to POs. Some Activities and POs are matched more than once - this is because there may be multiple invoices to the PO on the same activity; however, some POs are charged to more than one Activity, based on line items. Invoice number isn't really relevant to this query.
ACTIVITY is joined to INVOICE on the activitynumber field. PO is joined to INVOICE on the ponumber field. There are no primary keys in any of the tables.
What I'm trying to do is create a query between INVOICE, ACTIVITY, and PO that will list only those PO numbers (ponumber) that are associated with ALL codes (code) in the ACTIVITY table.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|