473,503 Members | 544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Merge Records From Multiple Sources

I have a people table of about 25 fields. The table is initially created each
year from 5 different sources. The records from each source are appended to the
people table. Any person may be in one or multiple sources. For those in
multiple sources, the data for a person may not be complete in any source. For
example, a person is in three sources; source#2 has the SSN and source#3 has the
membership#. For those people who are in multiple sources, I need to merge the
records of the person into one record that contains all the data for that person
that is available in all the sources that contain that person. From the previous
example, I need to add the membership# from source#3 to the record with the SSN#
in source#2.

I'm looking for some suggestions on a startegy for merging records.

Thanks!

Steve
Nov 12 '05 #1
3 3845
On Thu, 05 Feb 2004 01:40:23 GMT, "Steve" <sa****@penn.com> wrote:
I have a people table of about 25 fields. The table is initially created each
year from 5 different sources. The records from each source are appended to the
people table. Any person may be in one or multiple sources. For those in
multiple sources, the data for a person may not be complete in any source. For
example, a person is in three sources; source#2 has the SSN and source#3 has the
membership#. For those people who are in multiple sources, I need to merge the
records of the person into one record that contains all the data for that person
that is available in all the sources that contain that person. From the previous
example, I need to add the membership# from source#3 to the record with the SSN#
in source#2.

I'm looking for some suggestions on a startegy for merging records.


Update queries on joined tables will do it. Create a Query joining the
two tables; put a criterion of IS NULL on the SSN in the table you
want to update with the SSN; and update to

[othertable].[SSN]

or similarly for the other fields.

The problem may be - this presumes that you have some field that you
can count on to uniquely identify a person's record in all five
tables! Do you have such a field? I would *not* recommend using names
to do this; you could have two people who happen to have the same name
(which Steve Jones do you mean, the janitor or the CFO?); or you could
have a name in one table as "Steve Jones" and in the other as "Stephen
Jones".

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
Nov 12 '05 #2
John,

Thanks for responding!

My example over-simplified the problem. Suppose a person is in 4 sources. The
record I want is:
FName, LName, SSN, MembershipNum, SchoolDistrict, Position, City, State, Zip

The available data in the sources are:
#1: FName, LName, SSN, City, State, Zip
#2: FName, LName, MembershipNum, City, State, Zip
#3: FName, LName, SchoolDistrict, City, State, Zip
#4: FName, LName, Position, City, State, Zip

Steve
"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:56********************************@4ax.com...
On Thu, 05 Feb 2004 01:40:23 GMT, "Steve" <sa****@penn.com> wrote:
I have a people table of about 25 fields. The table is initially created each
year from 5 different sources. The records from each source are appended to thepeople table. Any person may be in one or multiple sources. For those in
multiple sources, the data for a person may not be complete in any source. Forexample, a person is in three sources; source#2 has the SSN and source#3 has themembership#. For those people who are in multiple sources, I need to merge therecords of the person into one record that contains all the data for that personthat is available in all the sources that contain that person. From the previousexample, I need to add the membership# from source#3 to the record with the SSN#in source#2.

I'm looking for some suggestions on a startegy for merging records.


Update queries on joined tables will do it. Create a Query joining the
two tables; put a criterion of IS NULL on the SSN in the table you
want to update with the SSN; and update to

[othertable].[SSN]

or similarly for the other fields.

The problem may be - this presumes that you have some field that you
can count on to uniquely identify a person's record in all five
tables! Do you have such a field? I would *not* recommend using names
to do this; you could have two people who happen to have the same name
(which Steve Jones do you mean, the janitor or the CFO?); or you could
have a name in one table as "Steve Jones" and in the other as "Stephen
Jones".

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public

Nov 12 '05 #3
On Thu, 05 Feb 2004 03:57:38 GMT, "Steve" <sa****@penn.com> wrote:
John,

Thanks for responding!

My example over-simplified the problem. Suppose a person is in 4 sources. The
record I want is:
FName, LName, SSN, MembershipNum, SchoolDistrict, Position, City, State, Zip
Ok, let's call this MasterTable... what's its Primary Key?
MembershipNum? If it has none... it's not a table, it's a random
collection of data which cannot be updated.
The available data in the sources are:
#1: FName, LName, SSN, City, State, Zip
#2: FName, LName, MembershipNum, City, State, Zip
#3: FName, LName, SchoolDistrict, City, State, Zip
#4: FName, LName, Position, City, State, Zip


Ok. Some painful questions here:

Table1 has a record for Fred Smith, SSN 445-44-4444, in Poughkeepsie;
and also a record for Fred Smith, SSN 454-44-4444, also in
Poughkeepsie.

Are they the same person? Is either one the same person as the Fred
Smith, SSN unknown, in Schenectady in the master table? If so, which
one? Or maybe it's the Frederick Smythe, SSN unknown, in Poughkeepsie

You MUST - NO OPTION!!! - have some way of uniquely identifying which
record is which. Names *are not such a method*. They're not stable,
they're not unique, and they're not reliable.

ASSUMING... and it's a heck of a big assumption - that the names are
reliable in this case, what do you want to do if Table1 has one
city/state/zip and Table2 a different City/State/Zip, and MasterTable
hase these blank? Maybe the person moved; which address should Access
use?

ASSUMING... even bigger assumption... that every record has FName,
LName, City, State and ZIP in all five tables, reliably and
accurately, you can construct five update queries. Create a unique
Index on these five fields in MasterTable. Create a Query joining
MasterTable to Table1 on the five fields and update MasterTable.SSN to

[Table1].[SSN]

Run the query by clicking the ! icon.

If you'll be doing this kind of exercise in the future, you may want
to look into a technique called "Replication". It's not for the faint
of heart, but it's designed so that you can make five replicas of a
database on five laptops, have people indpendently update all five,
and synchronize the data back into one table. See
http://www.trigeminal.com and search for Michka's Replication FAQ
there, it's the definitive word on the subject.

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
Nov 12 '05 #4

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

Similar topics

1
3150
by: Morris | last post by:
Does anyone know whether it is possible to effect a mail merge to MSWord using VBScript in an asp file? I know it is possible to produce a doc file and force a download using ...
2
1999
by: Steve Jebson | last post by:
I have 2 Customer Tables from different sources that i would like to merge into one master table. They have similar data but different field names and field orders. Is it possible to extract the...
3
5168
by: svdh2 | last post by:
I have been looking at a problem the entire week in access, I have still not been able to find a solution. Hope that you could maybe tell where to look Concerns the link between Access and Word....
8
4802
by: dd_bdlm | last post by:
Hi I wonder if anyone can help? I have looked through prevous posts and cant find any answers that fit what I need to do. For reference I am using Access 97 and Word 97. I want to be able to...
1
2053
by: law | last post by:
I love the super easy word merge but I have a question. In my database I select multiple records which I then want to merge to a single document in word. I use the single word merge and get one...
4
3798
by: Shaldaman | last post by:
Hi, We're running Office 2000 at our organization. We've been using an Access database that is shared on the network; we have forms in the database in which when we click on a button, data is...
3
11336
by: cdelarte | last post by:
I would like to be able to mail merge records from multiple mysql tables using a simple template, preferably via a command line script. MSWord mail merge via ODBC will not work for me as it only...
6
4630
by: crealesmith | last post by:
Firstly, I have no problem with mail merging to Word, VB code for that works perfectly. On one mail merge I need to merge 15 fields of data that are from 3 seperate records. The 3 records are all...
1
11447
by: kirkus84 | last post by:
I am currently trying to do a multiple record mail merge through a query via a command button on a form. The query basically displays customers who have said yes to privacy. The user inputs a date...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7087
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.