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,
cs
rporter45Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

peter57rCommented:
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 ).
0
Dale FyeOwner, Developing Solutions LLCCommented:
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
UNION
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.
 
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
0
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

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 -
cs
0
Dale FyeOwner, Developing Solutions LLCCommented:
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
0
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 -
Colleen
0
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 -
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.