Results 1 to 2 of 2
  1. #1
    gpasquali is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2010
    Posts
    1

    Query !!! ... please help!!!

    Hello,


    i have two tables:

    “Company” and “site” linked between a “ID_company”.
    In the “site” table there are information about the “subsidiary” (“type of subsidiary”, address, city, contact email etc).
    I need a query to have in a ROW all the information related to a company, for example:

    Company_name, .. , subsidiary_name1, address1, city1, contact email_1, subsidiary_name2, address2, city2, contact email_2, ….
    Please can you help me????
    that means that in 1 row will be all the information of a company.

  2. #2
    KLynch0803 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2009
    Posts
    37
    Quote Originally Posted by gpasquali View Post
    Hello,
    i have two tables:

    “Company” and “site” linked between a “ID_company”.
    In the “site” table there are information about the “subsidiary” (“type of subsidiary”, address, city, contact email etc).
    I need a query to have in a ROW all the information related to a company, for example:

    Company_name, .. , subsidiary_name1, address1, city1, contact email_1, subsidiary_name2, address2, city2, contact email_2, ….
    Please can you help me????
    that means that in 1 row will be all the information of a company.
    Here is a simple Query where I joined two tables using a query by itself not actually joining the table in relationships.

    Simply open query in design mode and drag ID to ID, right click the line and select option that best decribes which table you want to be primary and not (Most time option 2 is what everyone uses).

    Drag in all the fields you want from the two tables into the query and set your criteria, IE: FirstName criteria could be "John"

    Here is my sample SQL for my query for you to see.

    Code:
     
    SELECT tbl_Customers.CustomerID, tbl_Customers.FirstName, tbl_Customers.ZipCode, tbl_city_zip.City, tbl_city_zip.StateName
    FROM tbl_Customers LEFT JOIN tbl_city_zip ON tbl_Customers.ZipCode = tbl_city_zip.ZIPCode
    WHERE (((tbl_Customers.FirstName)="John"));
    Hope this helps

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums