Results 1 to 4 of 4
  1. #1
    squirrly is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2011
    Posts
    33

    Virtually combine two rows for dropdown

    Not sure what I'm looking for to make this work. I have three rows in a relational database table:


    1 lost
    2 found
    3 sighted

    The goal is to output LOST and FOUND from a dropdown list, with sighted items listed under FOUND.

    So I need to virtually combine found and sighted, but can't literally combine them as they are used separately elsewhere. Am thinking I need to either manipulate the dropdown list, or use additional SQL in the main table outputting the data. Probably the latter, just can't put my finger on it.

    I'm sure this is simple, but my mind goes blank if I am away from this for awhile and then work on it too hard.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    You have records that are coded as "Lost", "Found", or "Sighted" but you want the Found and Sighted records to be treated as one group?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    squirrly is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    33
    Yeah, I know it sounds bizarre. But I've done this successfully with another table using DISTINCT with another column, like this:

    1 Male....................M
    2 Female.................F
    3 Male, neut............M
    4 Female, spayed.....F

    The dropdown lists M and F, which then pulls all consolidated records accordingly. This approach isn't working with this other table. However, the query for the gender table is significantly different with JOINs and parameters.

    I just need to think about this further and figure out exactly what I'm asking the query to do for me and what tables the query involves for proper output. It sounds much simpler than it is!

  4. #4
    squirrly is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    33
    I worked it all out. Just had to logically manipulate the SQL in the table for the dropdown and the big table where the data was being pulled from.

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

Similar Threads

  1. Combine datatable rows based in common value
    By pipelian in forum Access
    Replies: 1
    Last Post: 11-27-2012, 10:20 AM
  2. Combine Two Rows - SQL Query
    By Somnath_IT2006 in forum Queries
    Replies: 1
    Last Post: 12-23-2011, 06:30 AM
  3. Query to find and COMBINE rows based on 2 fields
    By admessing in forum Queries
    Replies: 2
    Last Post: 12-13-2011, 12:59 PM
  4. combine rows
    By summerAIS in forum Queries
    Replies: 3
    Last Post: 07-31-2010, 10:13 PM
  5. Combine multiple rows into one cell
    By zarfx4 in forum Queries
    Replies: 8
    Last Post: 06-08-2009, 10:42 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