Results 1 to 4 of 4
  1. #1
    werfnerf is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    2

    "multiplying" fields

    Hi, I'm fairly new to Access. I'm trying to create a query that "multiplies" two fields from unrelated tables, to get all possible combinations. Essentially creating a 2-D array and then exploding it.

    For example, tab1.fieldX has the entries
    1, 2, 3
    tab2.fieldY has the entries
    a, b, c

    I want a query that will produce two columns, X and Y
    with entries
    1,a
    1,b


    1,c
    2,a
    2,b

    etc.

    Is this possible?

    Thank you!!

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Yes, just include both tables in the query and select the field from each table you want. Since the tables are unrelated, you will get a Cartesian product of the two tables.

  3. #3
    werfnerf is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    2
    Thanks! For some reason, I kept getting an error message when I tried. Whatever was wrong seems to have fixed itself.

    Thanks for your help!

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Glad to hear that you got it resolved.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-25-2011, 12:36 PM
  2. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 02:43 PM
  3. Replies: 5
    Last Post: 08-10-2010, 02:57 PM
  4. Replies: 4
    Last Post: 06-14-2010, 02:31 PM
  5. Link tables on "special" fields
    By Gargen in forum Access
    Replies: 0
    Last Post: 12-18-2008, 12:02 PM

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