Thursday, December 14

Linking Tables Together

Google+ Pinterest LinkedIn Tumblr +

The Visual Linking Expert opens automatically when you close the Data Explorer after connecting to a data source and selecting tables to use on your report if you have selected more than one table for your report. Using the Visual Linking Expert, you link your tables together and manipulate the join type. Before we jump right into a discussion of linking tables and join types,

Let’s look at the why.

Why You Need to Link Tables

When designing reports for your business, you most likely need to link two or mote tables together in order to have all the information you need avail­able. Most databases have much rabies, each table containing a certain type of information, two tables from a fictitious credit1 card company’s database,

The company’s database contains information needed for reports. In order to have information on your report from more than one table, you need to link the tables together. The fields used for linking must contain matching values.^ In order for smart linking to work properly, the fields must also have matching names and data types, and for string fields the field length must also match.

It is important to carefully choose the fields to use for linking, An easy way to choose a field, if two tables share several common fields, is to choose the field that uniquely identifies each record—like a social security number, bank ac­count number, or credit card number.

When you link two tables together, you need the information from one table to match the corresponding information from the other table. Think about the Free Credit Bank example discussed here. Say you work for this company and need to design a report to run monthly invoices. The company has two tables that you could use: Cardholder information and Purchases.

To design and run a report to run each cardholders monthly bill, you might want the cardholder name and address, account number, date of purchase, store / vendor,-aTid amount of each purchase. To design this information into a report you need several fields from both the Cardholder Information and Purchases tables.

Correct Unlink ensures that the information the report pulls from the Cardholder Information table matches the information pulled from the Pur­chases table. This way, the cardholder’s name printed on each bill matches the purchases listed” on the bill.

Account Number is .the best field to link in this example. Every cardholder has a unique Account Number, so even if two or more cardholders have thesame name, they will each get their correct bill. Cardholder Name, though common between the tables, would not be the best choice because two cus­tomers might have the same name.

Share.

About Author

Leave A Reply