473,320 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Merging tables

Hi

I have two tables with two columns each. Each table has an id column and a
value column. I would like the two tables to be merged so there are three
columns id, valuefromtable1 and valuefromtable2 and in such as way that all
records from both tables are included but where they don't match the
corresponding valuefromtable1 or valuefromtable2 is empty. How can I go
about doing this?

Thanks

Regards
Nov 26 '06 #1
1 1650
"John" <Jo**@nospam.infovis.co.ukwrote in
news:Bc********************@pipex.net:
Hi

I have two tables with two columns each. Each table has an id
column and a value column. I would like the two tables to be
merged so there are three columns id, valuefromtable1 and
valuefromtable2 and in such as way that all records from both
tables are included but where they don't match the
corresponding valuefromtable1 or valuefromtable2 is empty. How
can I go about doing this?

Thanks

Regards
You create a full outer join query. In Access, this has to be
simulated with a left join and a right join.

Begin by opening the query builder.
add the two tables, and
add a relationship between the ID columns.
Add the three fields.

Switch the query to SQL view.
Select all. and
paste the text back into the query a second time.
Change the semicolon that's in between the two statements to
UNION with a space on each side of it.

now find first instance of the words INNER JOIN
Change them to LEFT JOIN.
Find the second instance of the words INNER JOIN
Change them to RIGHT JOIN.

Save the query.
Run it.
copy and paste the results into your new table.
Sigh a sigh of relief, you're done.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Nov 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Walt Borders | last post by:
Hi, My problem: Merging two datasets deletes parent elements, preserves all children. I've created two dataSets. Each use the same schema, parent-child nested tables. The first dataSet is...
3
by: Patrick | last post by:
I have got 2 XML documents, both of which conform to the same XSD Schema, which define possible optional elements. The 2 XML documents contain 2 disjoint set of XML elements. What is the best,...
2
by: Emmett Power | last post by:
Hi, I have an Access table with a number of records which refer to the same person but with data in different fields. So for example the table would look like this: Name..............Field...
1
by: svdh | last post by:
I have posed a question last saturday and have advanced alot in the meantime. But I am still not there Problem is that I try to merging various fields from various tables in one document in Word...
2
by: Dan Cooper | last post by:
I've got two datasets, each containing a single data table. dstDataSetA.Tables("TableA") dstDataSetB.Tables("TableB") I want to merge them together and delete any non-matching rows. ...
7
by: Jon Vaughan | last post by:
I have 2 datasets , one returned as a dataset from a webservice and one created client side form the same stored procedure that is returned from the webservice. I then try and merge the data, but...
1
by: actimel01 | last post by:
I know this question has been asked many times before but I can't find an answer that fits my data! I have two Access databases. The tables in each have the exactly the same fields except for one...
0
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm trying to do mail merging in C#.NET and in one methods: Word.Application wrdApp; Word._Document wrdDoc; Object oMissing = System.Reflection.Missing.Value; Object oFalse = false; ...
7
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm trying to follow a mail merging example in C#.Net that I got from: http://support.microsoft.com/default.aspx/kb/301659 and in one the methods: Word.Application wrdApp; Word._Document...
2
by: Neil Chambers | last post by:
I am trying to get my head around dataset merging but despite a little research I could still use a pointer (or ten). Basically I want to perform an outer join operation on a dataset (created from...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.