Merge two tables columns

brandon20

Board Regular
Joined
Feb 12, 2014
Messages
203
Hi,

I am trying to merge the data from two columns together in access.

I have one table with oil wells and their well tops.
I have a bunch of oil wells, each of these oil wells has layers and the depths associated with them.

I have a second table with the oil wells and their final depths.


I need to combine the oil well final depth in the same column as the well layers.

How would I do this?
With a union query?

Thanks for any help

Example tables

Table1=WellLayerTable

WellLayerDepth
Well_1A100
Well_1B200
Well_1C300
Well_1D400
Well_1E500
Well_1F600
Well_1G700
Well_1H800
Well_1I900
Well_1J1000
Well_1K1100
Well_2A500
Well_2B600
Well_2C700
Well_2D800

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>


Table2=WellTDTable

Well Layer Depth
Well_1 FinalDepth 1500
Well_2 FinalDepth 2000
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
by combine, you could mean concatenate or you could mean sum. I can't make sense out of your examples either. Assuming you mean sum, I get 2600 for well 2 and I don't get 1500 for 1 either, so I probably can't help much beyond saying you might need an aggregate query. To create that, you 'turn on' the Totals option on the Ribbon in query design.
 
Last edited:
Upvote 0
Create a query with the below statement

Code:
(
SELECT Well, Layer, Depth
FROM WellLayerTable
)
Union All
(
SELECT Well, Layer, Depth
FROM WellTDTable
)
 
Upvote 0
I should have included a "what I want" table at the bottom to better describe what I was looking for.

PichaiTC Thanks! this was exactly what I was looking for. I knew it was a union query I was looking for, just wasnt sure how to write the sql.

Thanks again!!
 
Upvote 0

Forum statistics

Threads
1,221,829
Messages
6,162,229
Members
451,756
Latest member
tommyw

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