Results 1 to 3 of 3
  1. #1
    MrDummy is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    50

    Select unique values from multiple fields


    Hello,

    I have an issue. I have a query with three fields that containt double values. I want to have the unique values (could also be text and not only numbers) from these three fields. The values come directly from a table and not from another query. If possible I would like to have it in the same query and not to make a seperate query. The unique values are then used for dispalying pictures so every picture comes up once.

    In the attachement the unique values are then 4.3 5.1 5.2 6.1 8. The maximum unique values in these three fields is 8.

    Click image for larger version. 

Name:	Cut 1.JPG 
Views:	14 
Size:	15.3 KB 
ID:	22942

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,446
    try

    SELECT DISTINCT * FROM
    (SELECT Label1 FROM myTable
    UNION SELECT Label2 FROM myTable
    UNION SELECT Label3 FROM myTable) AS tbls
    Last edited by CJ_London; 12-06-2015 at 11:31 AM. Reason: correction to code

  3. #3
    MrDummy is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    50
    Perfect runs smooth. Many thanks

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

Similar Threads

  1. Replies: 8
    Last Post: 03-28-2014, 12:04 AM
  2. Replies: 5
    Last Post: 03-17-2014, 04:02 PM
  3. Replies: 14
    Last Post: 01-29-2014, 06:28 PM
  4. Unique ID's across multiple fields
    By mackoski in forum Access
    Replies: 3
    Last Post: 08-14-2013, 05:15 PM
  5. Unique Values and Boolean Fields
    By Triad in forum Forms
    Replies: 1
    Last Post: 07-15-2010, 06:28 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