Results 1 to 3 of 3
  1. #1
    mefox is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    2

    Consolidate Multiple Columns into Two Columns

    Hello, Everyone...

    I have a MS ACCESS 2010 database with a data table which i am trying to create a query from. I have 6 columns of data( one with an ID Field and 5 Name Fields). Below i have made examples of how it first appears as a simple query and the second will show you what i would like it to look like.

    What the simple query looks like:
    http://i1159.photobucket.com/albums/...eryExample.jpg

    Second what I want the query to look like:


    http://i1159.photobucket.com/albums/...eryExample.jpg

    This is probable an easy fix, and i would appreciate any help you can give. I am stuck on this

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    Using "UNION" should solve your problem. I called the table "Example".

    SELECT Example.Number, Example.Name1 AS Name
    FROM Example
    WHERE Example.Name1 IS NOT NULL
    UNION
    SELECT Example.Number, Example.Name2 AS Name
    FROM Example
    WHERE Example.Name2 IS NOT NULL
    UNION
    SELECT Example.Number, Example.Name3 AS Name
    FROM Example
    WHERE Example.Name3 IS NOT NULL
    UNION
    SELECT Example.Number, Example.Name4 AS Name
    FROM Example
    WHERE Example.Name4 IS NOT NULL
    UNION
    SELECT Example.Number, Example.Name5 AS Name
    FROM Example
    WHERE Example.Name5 IS NOT NULL
    ;

  3. #3
    mefox is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    2
    Thanks i knew it was something simple i was missing, thank you for solving this problem

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

Similar Threads

  1. Replies: 7
    Last Post: 01-02-2013, 11:23 PM
  2. Replies: 2
    Last Post: 05-17-2012, 03:52 PM
  3. Median value for multiple columns
    By MIS_Analist in forum Queries
    Replies: 2
    Last Post: 10-08-2010, 11:14 AM
  4. Consolidate multiple columns into one
    By COforlife in forum Access
    Replies: 17
    Last Post: 10-19-2009, 01:12 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