+ Reply to Thread
Results 1 to 5 of 5

join 4 tables

  1. #1
    Forum Contributor
    Join Date
    10-21-2010
    Location
    LONDON
    MS-Off Ver
    2007
    Posts
    108

    join 4 tables

    I have 4 tables i.e company_profile,company_people,area_of_work,area_of_practice.And out of that 3 tables have primary key which is company_id.The 3 tables are company_profile,company_people,area_of_work.4th table which is area_of_practice has common or matching field with area_of_work table which is practice_id.

    I want to create join to get results from all the four tables.

    Can anyone can help me.

    Thanks in advance.

    Lovinguy

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: join 4 tables

    Have you set up relationships between these tables?

    What do you want to return from the query?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    10-21-2010
    Location
    LONDON
    MS-Off Ver
    2007
    Posts
    108

    Re: join 4 tables

    Below are the details of table & column name

    COMPANY_PROFILE(tABLE)
    COMPANY_ID
    FIRSTNAME
    LASTNAME
    COMPANY_ID
    email
    phone
    address

    COMPANY_PEOPLE(TABLE)
    company_id
    state
    city
    country

    AREA_OF_WORK(TABLE)
    COMPANY_ID
    PRACTICE_ID
    WORK_SEQUENCE


    AREA_OF_PRACTICE(TABLE)
    CATEGORY
    PRACTICE_ID


    I want to pull or create a join query resulting company_id,first_name from COMPANY_PROFILE(TABLE).STATE & CITY FROM COMPANY_PEOPLE(TABLE).PRACTICE_ID FROM COMPANY_PEOPLE(TABLE).CATEGORY FROM AREA_OF_PRACTICE

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: join 4 tables

    Try this:
    Please Login or Register  to view this content.
    BTW: In the first table, company_profile, you have two fields with the same name--Company_ID. That won't work. Also, you indicated that you wanted the Practice_ID from the people table. I assumed you meant the Area of Work table as it is not listed in the People table.

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: join 4 tables

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] SQL Join - Left Join, but with 4 tables
    By kenny.fsw in forum Access Tables & Databases
    Replies: 4
    Last Post: 05-29-2013, 09:03 AM
  2. VBA Excel - Join Tables
    By janagan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2013, 01:21 AM
  3. VBA join tables
    By janulikb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2013, 02:23 PM
  4. JOIN three tables using ADO and JET
    By PingPing in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2010, 11:49 AM
  5. join tables with duplicate records ??
    By okl in forum Access Tables & Databases
    Replies: 1
    Last Post: 11-16-2009, 03:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1