SQL with Right & Left join help needed

foxhound

Board Regular
Joined
Mar 21, 2003
Messages
182
Hello,

I have two tables that I have combined in a union query as such:

SELECT [3DN], [Grp], [LOC], [BU], [TYPE], [XREF], [Sum Of ACTNUM] AS [ACTNUM], [ATHNUM]
FROM [qry_Actual Positions]

UNION SELECT [3DN], [Grp], [LOC], [BU], [TYPE], [XREF], [ACTNUM], [Sum Of ATHNUM] AS [ATHNUM]
FROM [qry_Authorized Positions];

[XREF] is my linked field. My question is how can I modify the above code to have [ACTNUM] and [ATHNUM] appear on the same row as one record instead of two separate records. Also, there are some records in [qry_Actual Positions] that aren't in [qry_Authorized Positions] and vice versa. I would like all records from both queries to be included.

Any assistance would be greatly appreciated.

Thanks in advance,

Foxhound
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Access spits the dummy if you try more than one outer join in a single query -- you'll get "Ambiguous Outer Join" errors. I get around this by stringing queries together in a sequence, each of which has a single outer join.

HTH
Denis
 
Upvote 0

Forum statistics

Threads
1,223,560
Messages
6,173,036
Members
452,500
Latest member
jesuisazep

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