MS query Outer Joins with more than two tables

Jubert

New Member
Joined
Jun 1, 2016
Messages
28
Hi
Can anyone help me amend the code to make the following two joins Left Outer Joins??
CST_COSTCENTRE.CC_LEVELPOINTER = arm_cc_group_names.cc_levelpointer
CST_COSTHEADER.CH_ACCOUNT = SL_ACCOUNTS.CUCODE

Full dump from SQL box below.
Thanks.


SELECT ARM_GP_GROUPINGS.GrpCode, arm_cc_group_names.cc_name, CST_COSTCENTRE.CC_CODE, CST_COSTCENTRE.CC_NAME, CST_COSTCENTRE.CC_LEVELPOINTER, CST_COSTHEADER.CH_CODE, CST_COSTHEADER.CH_NAME, CST_COSTHEADER.CH_USER3, CST_COSTHEADER.CH_USER4, CST_DETAIL.CT_NETT, CST_DETAIL.CT_SORTTYPE, CST_DETAIL.CT_PERIODNUMBR, CST_DETAIL.CT_YEAR, SL_ACCOUNTS.CUCODE, SL_ACCOUNTS.CUNAME
FROM GSLIVE.dbo.arm_cc_group_names arm_cc_group_names, GSLIVE.dbo.ARM_GP_GROUPINGS ARM_GP_GROUPINGS, GSLIVE.dbo.CST_COSTCENTRE CST_COSTCENTRE, GSLIVE.dbo.CST_COSTHEADER CST_COSTHEADER, GSLIVE.dbo.CST_DETAIL CST_DETAIL, GSLIVE.dbo.SL_ACCOUNTS SL_ACCOUNTS
WHERE CST_DETAIL.CT_COSTCENTRE = CST_COSTCENTRE.CC_CODE AND CST_DETAIL.CT_COSTHEADER = CST_COSTCENTRE.CC_COPYHEADER AND CST_COSTCENTRE.CC_COPYHEADER = CST_COSTHEADER.CH_CODE AND CST_COSTCENTRE.CC_LEVELPOINTER = arm_cc_group_names.cc_levelpointer AND CST_COSTHEADER.CH_ACCOUNT = SL_ACCOUNTS.CUCODE AND CST_COSTHEADER.CH_CODE = ARM_GP_GROUPINGS.ch_code AND ((CST_DETAIL.CT_YEAR='C') AND (CST_DETAIL.CT_PERIODNUMBR=1) AND (ARM_GP_GROUPINGS.GrpCode='*') AND (CST_DETAIL.CT_COSTCENTRE Like '4%'))
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,215,477
Messages
6,125,030
Members
449,205
Latest member
Eggy66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top