Excel won't let me do outer joins graphically (with more than 2 tables), but I know it can be done non-graphically, I just don't know how.
Here's what I have so far...
Here's the SQL for it...
This works fine WITHOUT Table XXXHF60P (the table on the far right)
Once I add that table and joins, I LOSE records from my results because the number of records in each table aren't the same.
I need to KEEP ALL records from XXXRE60P_2 and return ONLY records from XXXHF60P where the joins match.
Which means I will have some records with NULL values for fields that I select from XXXHF60P (such as XXXHF60P.HFDFCA) but that's ok, that's what I need.
Is this something that can be done just strictly via the SQL, without the graphical joins?
Here's what I have so far...
Here's the SQL for it...
SQL:
SELECT XXXRE60P.RBDTYR, XXXRE50P.RBMDNO, XXXRE06P.RMDNAM, XXXRE60P.RBDCTL, XXXRE50P.RBMON1, XXXRE50P.RBMON2, XXXRE50P.RBMOA1, XXXRE50P.RBMOA2, XXXRE50P.RBMOA3, XXXRE50P.RBMOCT, XXXRE50P.RBMOST, XXXRE50P.RBMOZP, XXXRE50P.RBMLUC, XXXRE50P.RBMSST, XXXRE50P.RBMSD1, XXXRE50P.RBMPD1, XXXRE50P.RBMPD2, XXXRE50P.RBMPD3, XXXRE50P.RBMCPV, XXXRE50P.RBMCLV, XXXRE50P.RBMCIV, XXXRE50P.RBMCMV, XXXRE50P.RBMCTV, XXXRE50P.RBMTXE, XXXRE50P.RBMACR, XXXRE60P.RBDTTC, XXXRE60P.RBDDSA, XXXRE60P.RBDFCA, XXXRE60P.RBDPNA, XXXRE60P_1.RBDTTC, XXXRE60P_1.RBDDSA, XXXRE60P_1.RBDFCA, XXXRE60P_1.RBDPNA, XXXRE60P_2.RBDTTC, XXXRE60P_2.RBDDSA, XXXRE60P_2.RBDFCA, XXXRE60P_2.RBDPNA, XXXHF60P.HFDFCA
FROM S1029086.IC1ASLIB.XXXHF60P XXXHF60P, S1029086.IC1ASLIB.XXXRE06P XXXRE06P, S1029086.IC1ASLIB.XXXRE50P XXXRE50P, S1029086.IC1ASLIB.XXXRE60P XXXRE60P, S1029086.IC1ASLIB.XXXRE60P XXXRE60P_1, S1029086.IC1ASLIB.XXXRE60P XXXRE60P_2
WHERE XXXRE60P_1.RBDCTL = XXXRE60P.RBDCTL AND XXXRE60P_1.RBDTYR = XXXRE60P.RBDTYR AND XXXRE60P_2.RBDCTL = XXXRE60P.RBDCTL AND XXXRE60P_2.RBDCTL = XXXRE60P_1.RBDCTL AND XXXRE60P_2.RBDTYR = XXXRE60P.RBDTYR AND XXXRE60P_2.RBDTYR = XXXRE60P_1.RBDTYR AND XXXRE50P.RBMCTL = XXXRE60P.RBDCTL AND XXXRE06P.RMDDNO = XXXRE50P.RBMDNO AND XXXHF60P.HFDCTL = XXXRE60P_2.RBDCTL AND XXXHF60P.HFDTYR = XXXRE60P_2.RBDTYR AND XXXHF60P.HFDTTC = XXXRE60P_2.RBDTTC AND ((XXXRE60P.RBDTYR=?) AND (XXXRE60P.RBDTTC=100) AND (XXXRE60P_1.RBDTTC=200) AND (XXXRE60P_2.RBDTTC=300))
ORDER BY XXXRE60P.RBDCTL
This works fine WITHOUT Table XXXHF60P (the table on the far right)
Once I add that table and joins, I LOSE records from my results because the number of records in each table aren't the same.
I need to KEEP ALL records from XXXRE60P_2 and return ONLY records from XXXHF60P where the joins match.
Which means I will have some records with NULL values for fields that I select from XXXHF60P (such as XXXHF60P.HFDFCA) but that's ok, that's what I need.
Is this something that can be done just strictly via the SQL, without the graphical joins?