Try it!
Sometimes you need to create a query to pull information from data sources that don't have a direct (one-to-one or one-to-many) relationship.
Use intermediate tables to connect data sources in queries
When you run a query, Access uses the relationships you've created between tables and it deduces and creates connections between other data sources. If the relationship you need for a query doesn't exist, connect the tables as part of that query.
Suppose you want to see how many orders you've received for products from different suppliers. Your Suppliers table isn't connected to your Purchase Order Details table, which contains the product IDs and quantity information. However, the Purchase Orders table is connected to the Purchase Orders Details table.
Tip: If you might need this relationship outside the query you're creating, it's best to create an intermediate relationship for later use. To learn how, see Create many-to-many relationships.
If you don't want to create the intermediate table in your database, use the Purchase Orders table as the intermediate table in your query. Add the Suppliers table to the left of the Purchase Orders table, and create a connection.
The Purchase Orders table connects the two disparate tables, Suppliers and Purchase Order Details. Connect the tables using fields (such as ID in the Supplier table, and Supplier ID in the Purchase Orders table) that meet the following criteria:
-
The two fields have matching or compatible data types. For example, you can't connect a text field to a number field.
-
The fields identify matching, unique records in each table. For example, you wouldn't want to connect two Last Name fields because last names aren't always unique.
-
The fields ensure that the correct records result. For example, if you connect Supplier ID to Purchase ID, you might get some matches if the IDs are similar. But the results won't make sense because the Supplier ID has nothing do with the Purchase ID. A better choice is to connect ID from the Supplier table to Supplier ID in the Purchase Orders table—the records returned will make sense because both fields identify the supplier.
Steps
Whether you have an intermediate table in your database or just plan to use one in your query, follow these steps:
-
Add the intermediate table to your query between the two unconnected tables.
-
Create any needed connections with the intermediate table.
Connections can use any appropriate type of join but must be connected through fields that meet the criteria described earlier in this module.
-
Complete the query.
Follow the usual steps for creating a query: add output fields, add any criteria, and run or save your query. To learn how, see Create basic queries.
Note: You don't have to include the intermediate table in your results. It just needs to be part of the query's data sources so that Access can connect the data.
Want more?
Create queries by joining more than one data source
IF YOU NEED A LOAN NOW EMAIL CONTACT drbenjaminfinance@gmail.com
ReplyDeleteTODAY I GOT MY DESIRED LOAN AMOUNT $520,000.00 FROM A RELIABLE AND TRUSTED LOAN COMPANY. IF YOU NEED A LOAN NOW EMAIL CONTACT drbenjaminfinance@gmail.com
Hello, I'm here to testify of how i got my loan from BENJAMIN LOAN FINANCE(drbenjaminfinance@gmail.com) I don't know if you are in need of an urgent loan to pay bills, start business or build a house, they offer all kinds of loan. So feel free to contact Dr. Benjamin Owen he holds all of the information about how to obtain money quickly and painlessly without cost/stress via Email: drbenjaminfinance@gmail.com
I invested $95,420 in Bitcoin trading from an unregulated broker, I feel agitated about my situation, even find my life in a difficult time to make withdrawal from my account, I Saw a post about An online fund charge back recovery company going through some page here on this platform, at *www thedailychargeback com* ,I gave them all the information they needed to place the recovery. To my surprise I successfully got my funds off that broker confirming the payment on my wallet account, I highly recommend their service to others.
ReplyDeleteI was able to get eviction, foreclosure, bankruptcy, and liens removed from my credit report with the help of Rootkits Credit Specialist; they are currently the best. They also raised my credit score from 533 to 783, which is a fantastic number, and they did this in less than 11 days. They are the best of them all. They're safe, secure, reliable and fast. Contact them by mail via : ROOTKITSCREDITSPECIALIST at GMAIL dot COM or via WhatsApp: +18155248116 for quick service at a reasonable cost for all kinds of credit related issues.
ReplyDelete