![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi. This is a newbie question. I have a database with several tables that contains phone numbers for the same persons. That database keep getting more and more different tables from different sources. These tables are obviously different in name and the name of the phone number field is also different from one table to another. For example: Table name Person Id field name phone number field name ---------- -------------------- ----------------------- customers customerId customerPhone Addressbook PersonId PhoneNumber employees ID phone I know that the ID field has the same data for each person on all the tables(i.e. person 1 in customers table is person 1 and is person 1 in employees in addressbook etc.) I also have a table of persons in advance. I want to create a query that each time will create (or add to) a table that has all the phones for each person from all the tables. I think I should build a table that will be used as a cursor, but I don't know how to put it in a query, since the QBE needs a table name to run on, and that is not the case. Is there a way to do it (in sql query or with a combination of VBA code)? Thanks. Doron. |
#3
| |||
| |||
|
|
Hi Doron, You don't have a database, you have a mess! In relational database design, you will have tables designed to represent the entities in your database. Each entity can be referenced from many places but will exist exactly once in the database. In this case, there should be only one table for Person. An individual should appear in that one table exactly once. HTH -- -Larry- -- |
#4
| |||
| |||
|
|
Thanks Larry, I know it's a mess, but that is exactly the problem! I have many tables from different sources and I need to combine them to one table, with the data they carry (as in the example I gave). Now, if it was an action that needed to be carried only once, I wouldn't mind doing it manualy. But since I know that such data about the same persons will keep coming, I need an automated procedure, that will read the data from any table and add it to the single table. Doron. "Larry Daugherty" <ladaugherty (AT) NoSpam (DOT) earthlink.net> wrote Hi Doron, You don't have a database, you have a mess! In relational database design, you will have tables designed to represent the entities in your database. Each entity can be referenced from many places but will exist exactly once in the database. In this case, there should be only one table for Person. An individual should appear in that one table exactly once. HTH -- -Larry- -- |
#5
| |||
| |||
|
|
You need to explain why you have so many different sources of data for the same people or simply different sources and formats for the same kind of data. ?? Your problem may be technical, in which case you'll get a technical solution. On the other hand, it may be political - in that case, a technically elegant solution won't help a bit. If the data from a given source is always in the same form then it's possible to create an update query to add the data from the source table to the destination table. A separate query for each source table. The queries can all be run behind a command button. When done adding in the new data you can weed out any duplicates. On the other hand, if the format of the data varies from the same source, you're inescapably stuck with continual manual intervention. Alternatively, you could provide your sources with access to your database via data entry forms. That way, once their data is entered, you're already done. HTH -- |
![]() |
| Thread Tools | |
| Display Modes | |
| |