Tuesday, September 28, 2021

Video query unrelated data sources

Your browser does not support video.

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.

Multiple table data sources, with and without predefined relationships.

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.

Using one table to indirectly connect two other tables

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:

  1. Add the intermediate table to your query between the two unconnected tables.

  2. 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.

    Creating needed connections with the intermediate table
  3. 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 basic queries

Create queries by joining more than one data source

Create queries with outer joins

Excel training

Outlook training

4 comments:

  1. IF YOU NEED A LOAN NOW EMAIL CONTACT drbenjaminfinance@gmail.com


    TODAY 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

    ReplyDelete
  2. Hello Everyone,

    Welcome to the future! Financing made easy with Prof. Mrs. DOROTHY LOAN INVESTMENTS

    Have you been looking for financing options for your new business plans, Are you seeking for a loan to expand your existing business, Do you find yourself in a bit of trouble with unpaid bills and you don’t know which way to go or where to turn to? Have you been turned down by your banks? MRS. DOROTHY LOAN INVESTMENTS says YES when your banks say NO. Contact us as we offer financial services at a low and affordable interest rate of 2% for long and short term loans. Interested applicants should contact us for further loan acquisition procedures via profdorothyinvestments@gmail.com

    Services rendered include:

    *Refinancing Loans
    * Car Loan
    *Truck Loans
    * Home Loan
    * Mortgage Loan
    * Debt Consolidation Loan
    * Business Loan [secure and unsecured]
    * Personal Loan [secure and unsecured]
    * Students Loan and so many others.

    For more info; Contact us via Email: profdorothyinvestments@gmail.com

    With Prof. Mrs. DOROTHY LOAN INVESTMENTS. you can say goodbye to all your financial crisis and difficulties as we are certified, trustworthy, reliable, efficient, fast and dynamic

    ReplyDelete
  3. 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.

    ReplyDelete
  4. I 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