Results 1 to 5 of 5
  1. #1
    birdie2020 is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2020
    Posts
    2

    Filtering

    I have data that looks like this:



    ID. Code
    12345. 2391
    12345. 2392
    56789. 2391
    56789. 2391

    I'm trying to figure out how to bring in just those with IDs that have BOTH 2391 and 2392 not just one or the other. How would I do that in Access? And if anyone knows, how would I do it in Excel as well?

    Thank you

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    I have a tPicked table. Add all the codes to filter into it.
    join this table to the main data table and on those will show.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    perhaps something like

    select *
    FROM myTable A INNER JOIN myTable B ON A.ID=B.ID
    WHERE A.Code=2391 AND B.Code=2392

    no idea how you would do it in excel

  4. #4
    birdie2020 is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2020
    Posts
    2
    Well I want both codes to come in:

    Wouldn't that be A.Code in(2391,2392) AND B.Code In(2391,2392)

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    suggest try it - but with your suggestion all you will do is bring through the same records twice, actually, 4 times

    2391 - 2392
    2391 - 2391
    2392 - 2391
    2392 - 2392

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

Similar Threads

  1. Filtering for
    By Calhoontuna in forum Access
    Replies: 9
    Last Post: 05-14-2019, 09:54 AM
  2. Filtering out data
    By aaslezak in forum Reports
    Replies: 1
    Last Post: 06-01-2015, 11:31 AM
  3. Yes/No filtering
    By cgalvin in forum Reports
    Replies: 1
    Last Post: 05-11-2015, 05:59 PM
  4. Filtering
    By BannedOak in forum Access
    Replies: 9
    Last Post: 05-22-2011, 02:10 PM
  5. filtering
    By nashr1928 in forum Forms
    Replies: 12
    Last Post: 07-01-2010, 06:30 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