Creating two tables from one based on data common in both tables

Hi there,

I have a table exported from a database that I am attempting to splice into two tables.

The one table contains a list of records and their spouses along with IDs.

For example

123 Sue Smith     895 Steve Smith
895 Steve Smith  123 Sue Smith

Each spouse is listed twice - one as the main record or "constituent' and the other as the spouse.

How do I separate this into two tables where I can have the following:

table one: 123 Sue Smith
table two: 895 Steve Smith

I have exhausted any imaginative thoughts I have about this - any help would be greatly appreciated!

Thank you in advance,
Who is Participating?
Dale FyeCommented:
Why would you want to do this?

Actually, what might be preferable is to create a People table (tbl_People) from you first table, which would contain fields PeopleID, and People_Name (although first and last would be better if separated).

You could create this table using a union query that looks like:

SELECT [NameField] FROM your Table WHERE [NameField] IS NOT NULL
SELECT [SpouseField] FROM yourTable WHERE [SpouseField] IS NOT NULL

Then, you could go back to your original table, add fields for PeopleID, and SpouseID, and store those values rather than the names.  This way, when you edit information in the People table, it would reflect appropriately in your main table.
Some idea of the purpose might be helpful.
In database design terms , t here is no obvious reason why you would do anything other than delete the second name from the existing table (but keep the id ).
rporter45Author Commented:
Hi there,

I am hoping this will help to clarify - this is a fundraising software package called Raiser's Edge.  A donor can contribute money and that money can be soft-credited (no cash value) to the spouse so that their giving histories are equal.

There isn't a function that will help us identify what gifts have NOT BEEN soft credited to the spouse and as a result need to take the information out of the database and into access.

Because both wife and husband are spouses with their own records, there isn't a way to extract one or the other, it comes out in one table.  

I have created a sample attached - I hope this helps,

Thanks very much to you for your quick responses!
cs Example-for-Submission.xlsx
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

rporter45Author Commented:
I am presuming by the lack of posts that this is either not possible or is not clear enough.
If not possible, please advise so that I do not continue to review the case,

Thank you -
Dale FyeCommented:
In my post, I asked why you would want to seperate these into two tables, and none of your answers really address that.

I assume that there are other columns in your dataset, a date maybe, an GiftID which uniquely identifies the gift.  What is it you really want to know?  Provided what you have given us, you could create simple query that identifies the gift amount and the "Missing Soft Credit to Wife/Husband", something like:

SELECT GiftID, GiftDate, Name, SpouseID, [Spouse Name], "Missing soft Credit to " & [Spouse Relationship]
FROM yourTable
WHERE [Soft Credit Name] & "" = ""
AND [Spouse Name] & "" <> ""

This would identify those records where the [Soft Credit Name] field is blank but where the [Spouse Name] field is not blank
rporter45Author Commented:
Hi there,

That attached document does attempt to address this but it has a fundraising background component to understanding why and the software is difficult to understand though general comments - it's honestly hard for me to translate but I think you have hit the target.

I will try what you are stating and get back,

Thank you -
rporter45Author Commented:
This didn't provide the solution but did put me into the line of questioning I needed to find an alternative.

Sorry for the delay in responding,
Thanks -
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.