Results 1 to 2 of 2
  1. #1
    mkc80 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    56

    Combine results from 3 different queries in to one

    I am trying to combine the results from 3 different queries in to one result table.


    The Customer ID is the primary key in all 3 queries.

    The structure of the 3 queries is as follows:
    Query1: Customer-ID, product-1
    Query2: Customer-ID, prodcut-2
    Query3: Customer-ID, product-3

    product-1, product-2, product-3 are all numeric fields which represent the count of product-x purchased by that customer.

    I need a final table (union of these 3 queries) with the following columns: Customer ID, product-1 product-2, product-3

    If some of the ID's are missing in any of the queries (meaning if its present in one query and not others), the product info should be set to 0.

    Any suggestion on how to write a union query for this in MS Access?

  2. #2
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    Combine results from 3 different queries in to one

    Have you tried using the Query Builder?

    A basic Union Query is

    SELECT FieldList FROM Table1
    UNION
    SELECT FieldList FROM Table2
    UNION
    SELECT FieldList FROM Table3

    (You might need the UNION ALL)

    Check out
    http://office.microsoft.com/en-gb/ac...010206109.aspx

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

Similar Threads

  1. Combine Results of Two Queries
    By Ganymede in forum Queries
    Replies: 3
    Last Post: 12-28-2012, 02:00 PM
  2. Replies: 1
    Last Post: 10-23-2012, 02:04 PM
  3. How do I combine query results?
    By neha in forum Queries
    Replies: 2
    Last Post: 12-29-2011, 11:30 PM
  4. Combine query results
    By broadm in forum Queries
    Replies: 2
    Last Post: 04-15-2011, 08:37 AM
  5. Combine queries results in forms
    By frasilvio in forum Queries
    Replies: 12
    Last Post: 01-10-2008, 01:34 AM

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