Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Mar 2003
    Location
    Toronto, Ontario, Canada
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Merging Tables (2002)

    I'm pretty green with regard to Access .. so I hope this makes sense.

    I have two different databases - both containing customer information. They have some - but not completely - similar field headings. I would like to merge the two tables together. I have found a long route which involves pulling everything into Excel where I can cut and paste - but I haven't found anything in Access. Is there a way of doing this?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Merging Tables (2002)

    One possibility is to create a union query. Such a query has to be created in SQL view. Start by creating a query in design view, then select View | SQL. You have to write a SQL statement like this:

    SELECT Field1, Field2, Field3 FROM Table1
    UNION
    SELECT FieldA, FieldB, FieldC FROM Table2

    The corresponding fields from Table1 and Table2 must be of the same type, e.g. Field1 and FieldA must both be text fields, or both be number (long integer) fields etc. If you want to include a field that occurs in only one table, you can use Null in the other one:

    SELECT Field1, Field2, Null As Field3 FROM Table1
    UNION
    SELECT FieldA, Null As FieldB, FieldC FROM Table2

    Here Field2 has no equivalent in Table2, so Null is used for Table2, and FieldC has no equivalent in Table1, so Null is used for Table1.

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Merging Tables (2002)

    Could a customer have info in both databases, or is it just 2 sets of customers?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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