Results 1 to 9 of 9
  1. #1
    vis65 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    4

    to join columns

    Hello everybody,



    I have a table with 9 columns and 4 rows as I show on the following picture.

    Click image for larger version. 

Name:	picture 01.JPG 
Views:	15 
Size:	22.3 KB 
ID:	26282

    I would like a query to join the columns with the same field as I show on the following picture.

    Click image for larger version. 

Name:	picture 02.JPG 
Views:	15 
Size:	18.3 KB 
ID:	26283

    I have windows 7 and access 2013

    Thank you so much.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Are you trying to redesign your table?
    You table is not normalized.
    see this link for more info on Normalization
    Good luck.

  3. #3
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Weird. My post just seemed to vanish. I said the same, plus that spaces in field names are a no-no if the sample is accurate. If there are no spaces, you're just making it more difficult to provide example sql statements.

    Also said that you'd have to use a UNION query

    SELECT [Item 1] As Item, [Price 1] As Price, [Units 1] As Units FROM tblSomeTable
    UNION ALL
    SELECT [Item 2], [Price 2], [Units 2] FROM tblSomeTable
    UNION ALL
    SELECT [Item 3], [Price 3], [Units 3] FROM tblSomeTable;
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    your table is designed wrong.
    you only need 3 columns
    ITEM, PRICE, UNITS

    so make 3 queries to add them to the redesigned table.
    q1 = 1st 3 coluims
    Q2 = 2nd 3 columns
    etc

  5. #5
    vis65 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    4
    Thank you Orange (Moderator) for the valuable information about the website of Roger (It is a blog very useful) and specially thank you to Micron for the code, it works perfectly. Also I would like to say that my database has a lot of spaces because I have imported it from an excel spreadsheet.
    And in response to Ranman256, that’s true that I only need 3 columns, but I got automatically this information with this design from an Excel spreadsheet, but thank you anyway for your observation ;-)

    Thank you so much to everybody!

  6. #6
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Ok, just figured out that my post was actually in an Excel forum, which means this is cross posted here
    http://www.mrexcel.com/forum/microso...ml#post4670114

    vis65: you need to read this, lest you find that further issues you post go unanswered. I will add this to your Excel post as well.
    http://www.excelguru.ca/content.php?184
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    vis65 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    4
    Quote Originally Posted by Micron View Post
    Ok, just figured out that my post was actually in an Excel forum, which means this is cross posted here
    http://www.mrexcel.com/forum/microso...ml#post4670114

    vis65: you need to read this, lest you find that further issues you post go unanswered. I will add this to your Excel post as well.
    http://www.excelguru.ca/content.php?184
    I am really sorry Micron. I really read the forum rules but I have never heard about the forum cross posters. I just read << http://www.excelguru.ca/content.php?184>>. I apologize. Thanks for your warning.

  8. #8
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Don't take it too hard, I only meant that many responders won't answer a post that has been cross posted (provided they notice it first).
    It is usually an honest mistake that doesn't get repeated once you realize the aggravation that it can cause. Thanks for reading the treatise on cross posting, and on behalf of everyone else, welcome to the forum! We're here to help whatever way we can.
    Last edited by Micron; 10-30-2016 at 04:11 PM. Reason: grammar

  9. #9
    vis65 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    4
    Quote Originally Posted by Micron View Post
    Don't take it too hard, I only meant that many responders won't answer a post that has been cross posted (provided they notice it first).
    It is usually an honest mistake that doesn't get repeated once you realize the aggravation that it can cause. Thanks for reading the treatise on cross posting, and on behalf of everyone else, welcome to the forum! We're here to help whatever way we can.
    Ok, thank you Micron.

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

Similar Threads

  1. Replies: 3
    Last Post: 04-15-2016, 12:19 PM
  2. Unequal cross join on 2 different columns
    By NikNeedsHelp in forum Queries
    Replies: 3
    Last Post: 02-13-2016, 12:36 PM
  3. Replies: 6
    Last Post: 11-19-2013, 01:38 AM
  4. Outer Join Nested in Inner Join
    By Stevens7 in forum Queries
    Replies: 2
    Last Post: 10-19-2011, 01:34 PM
  5. Inner Join on Sorted Columns
    By Nobody in forum Queries
    Replies: 6
    Last Post: 08-24-2010, 03:28 PM

Tags for this Thread

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