Results 1 to 7 of 7
  1. #1
    oilcorner is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    3

    Red face combining two single-column tables into one two-column table

    Hi all,

    I'm new here and and this is probably a silly question, but please bear with me

    I'm trying to do something that one would normally never want to do for any reason I can think of, but I still really want to do it. Let's say I have two tables: table1 and table2. Both have exactly the same number of rows and only one column. For example:

    Table1:
    -------
    apple
    pear
    banana
    orange
    grapefruit

    Table2:
    -------
    monkey
    lion
    bear
    dog
    mouse

    Now I'd like to combine them into the following table with two columns:

    Table3:
    --------
    apple monkey
    pear lion
    banana bear
    orange dog
    grapefruit mouse

    So basically, just glue the two together. The tables have no obvious relationships or anything, and it's kinda hard to explain why I would ever want to do this, but still.... I can't seem to find out how to do this? It seems like it should be very simple (and it probably is). Could you please help me out..?



    Thanks a lot in advance.
    Last edited by oilcorner; 01-13-2012 at 04:44 AM. Reason: Setting status to solved

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The only way I can think of to do it would be to impose a relationship. Add a numeric column to both tables and number the records 1-5 in each. Then you have a field you can join on in a query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    dblife's Avatar
    dblife is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    104
    if 'apple' and 'monkey' shared the same foreign key, i imagine there would be a way to employ a union query with some concatenation...

  4. #4
    oilcorner is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    3
    Thanks very much to both of you for taking the time to answer. I'm a little too beginner to fully understand dblife's answer, but I think I will give pbaldy's suggestion a go tomorrow.

  5. #5
    dblife's Avatar
    dblife is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    104
    it's the same as pbaldy's but they had the sense to express it more simply...

  6. #6
    oilcorner is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    3
    It's working great, thanks a lot

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 5
    Last Post: 12-01-2011, 05:38 PM
  2. combining 3 columns into 1 new column!
    By joebox8 in forum Queries
    Replies: 7
    Last Post: 07-06-2011, 01:46 AM
  3. Replies: 1
    Last Post: 03-14-2011, 10:04 AM
  4. Replies: 7
    Last Post: 10-08-2010, 09:48 AM
  5. Replies: 1
    Last Post: 08-21-2009, 06:52 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