If you don't spend every day hip deep in databases, you might not always be clear on the whole primary key thing, and how to join them.
I want to clarify that this will work.
Let's say you've got two tables.
One is a table with city residents' IDs and names, street numbers, street names, etc.
The other is a table with street names and the days on which garbage is collected.
You need to send people a letter telling them what day their garbage is collected on. Thus you need to link the two tables.
The primary key on the first table, the ID field, is different than the primary key on the second. The primary key on the second could be the street name since the street name is unique in that table.
1 Oak Monday
2 Elm Monday
3 Main Tuesday
and so on.
To create the query, you don't need to link the primary keys. You can link the two tables simply by connecting the two Street Name fields when you create the query.
1. Open the database file containing the two tables.
2. Click the Queries icon at the left.
3. Click the option to create a query in design view.
4. In the window that appears, select the first table name and click Add.
5. Select the second table name and click Add.
6. Click in the second table, on the common field, in this case the StreetName field, and drag your mouse to the other table's StreetName field. (If this doesn't work, drag from the first table's field to the second table's field.)
7. Now create your query. Double-click the name of any field you want in the query. In this case it might be Name, Street Number, Street Name, and Garbage Day.
Run the query by clicking the Run Query icon.
The results will appear.
Now create your mail merge. You can create a new Text Document and choose View > Data Sources. Open the database containing the query and under Queries select the query you created
Drag the fields you want into the letter. You might want it like this.
It would be nice to have also an example with three tables. I.e. AddressesTable, LinkAddressesCategories, and Category table.
This way one could show how to resolve a many to many relationship.
Posted by: Fundi | February 28, 2008 at 03:28 PM
AddressesTable, LinkAddressesCategories, and Category table. http://www.batterygoshop.co.uk/uniwill/255-3s4400-g1l1-battery.htm uniwill 255-3s4400-g1l1 battery ,
Posted by: thmas | November 11, 2008 at 12:35 AM