joining these 2 tables

 3 Replies
 1 Subscribed to this topic
 43 Subscribed to this forum
Sort:
Author
Messages
wally
Basic Member Send Private Message
Posts: 11
Basic Member
I am trying to join two tables, APINVOICE and APDISTRIB. Can you please help me understand the following below which is posted on https://www.lawsonguru.co...ables/APINVOICE.html

Scroll down to the "one to many relationships" then to the APDISTRIB part.

Is that saying I need to join API-OBJ-ID to both APD-API-OBJ-ID and APD-DIST-SEQ-NBR or is it saying I have a choice between the two?
Kwane McNeal
Veteran Member Send Private Message
Posts: 479
Veteran Member
The link is with OBJ-ID. The reason SEQ-NBR is also needed is that it's possible that there are multiple distributions for a single invoice, usually when you have partial pays, or recurring invoices and the like.
wally
Basic Member Send Private Message
Posts: 11
Basic Member
so then I link API-OBJ-ID to "both" APD-API-OBJ-ID AND APD-DIST-SEQ-NBR?
John Henley
Send Private Message
Posts: 3351
No, you left outer join from APINVOICE (API) to APDISTRIB (APD) by joining API.OBJ_ID to APD.API_OBJ_ID.
You do not include APD-DIST-SEQ-NBR in the join.
Thanks for using the LawsonGuru.com forums!
John