[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to set up a condition for datacopying a specific field from one database to another?

Posted on 2011-09-28
2
Medium Priority
?
322 Views
Last Modified: 2013-11-27
I have two databases (which consist of two imported csv-files).

The first database contains data like this:

user-ID            Full name      Surname            Firstname
user-ID2      Full name2      Surname2      Firstname2
user-ID3      Full name3      Surname3      Firstname3

The second databse contains data like this:

Full name      Surname            Firstname      Class
Full name2      Surname2      Firstname2      Class2
Full name3      Surname3      Firstname3      Class3

The names/users are mostly the same in both databases, but there are some extra users in the first one, but only one of them contains the user-ID's, and only one of them contains the class-ID. What I need to do is to create a list of all the users who exist in both databases. And therefore I guess that the appropriate approach would be to copy the user-ID from the first database to the second.

So the result would be like this:

user-ID            Full name      Surname            Firstname      Class
user-ID2      Full name2      Surname2      Firstname2      Class2
user-ID3      Full name3      Surname3      Firstname3      Class3

But I need to set up a condition for the copying. Something like:

if "surname" and "firstname" in database 1 exist in database 2, copy the field "user-ID" to database 2.

I am trying to achieve this in Microsoft Access 2010, but I am new to Access, so if you can help - you don't need to worry about beeing to precise in your explanation ,-)

p.s. as the databases consist of imported csv-files, I wonder if the procedure above could as easily be done in Excel?
0
Comment
Question by:andre_st
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
Bill Ross earned 2000 total points
ID: 36716170
Hi,

1. Create a new database.
2. Use Link Table Manager to link both tables from the other 2 databases.
3. Create a new query.
4. Add both tables.
5. Join the 2 tables by Surname=Surname and Firstname=Firstname (this will get a list of matches between the 2 tables - assuming there are no duplicates)
6. Make the output Surname, Firstname and user-ID
7. View and if OK change to Make Table query
8. Run it
Now you have a list of Surname and FirstName with the associated user-ID you can then use to update the correct table.

If you need more detail just le tme know.

Bill
0
 

Author Comment

by:andre_st
ID: 36813067
Hey Bill!

Thanks for you reply! I got your suggestion to work ,-) Even though many follow up question turned up, I still got the answer to my initial question. But I'm gonna try to figure out the rest myself.

Kind regards,
André
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question