Results 1 to 5 of 5
  1. #1
    saharka is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2017
    Posts
    3

    How to find if data is in a column or another?


    Hello people i'm very new to access.


    This is the thing: I have to know if data is contained in a column of one of three queries. In excel I would do this by a combination of ifs, iserror and match or ifs and vlookups, but I have failed miserably on access.

    This is an example of what I want:

    Click image for larger version. 

Name:	Untitled.jpg 
Views:	6 
Size:	19.7 KB 
ID:	28168

    This is how I would do it in excel:
    Click image for larger version. 

Name:	Untitled2.jpg 
Views:	6 
Size:	15.1 KB 
ID:	28169
    Any ideas on how to do this inside a query?

    thanks
    Last edited by saharka; 04-07-2017 at 11:44 AM.

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Could you tell us in more detail what the no's and yes's represent - 1 8 5 no means that 1 doesn't exist anywhere else, 8 doesn't exist anywhere else, 5 ?

  3. #3
    saharka is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2017
    Posts
    3
    I just noticed that the text editor did not respect my spaces I will try to fix this.

    No means that the number in the column "Code (main)" does not exist in the columns "Query 1" or "Query 2"
    Yes means that the number in the column "Code (main)" exists in the columns "Query 1" or "Query 2"

    For example 1 is a no because 1 it does not exist in the columns Query 1 or Query 2, 4 is a yes because it exists in Query 1 even if it does not exist in Query 2 and 3 is a yes because it exists in both Query 1 and 2.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Create a new query that brings in all three queries. Left join the main query to the same field in the other two (right-click on the join > join properties > select all from main table). Then add a new field in the query for your yes/no (change Field1 to the name of your field):

    IIf(IsNull([query2].[Field1]),IIf(IsNull([query3].[Field1]),"no","yes"),"yes")

  5. #5
    saharka is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2017
    Posts
    3
    Ohh great, I will try it out thanks!

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

Similar Threads

  1. Query to find Partial Match of Column Data
    By rachmorr9 in forum Queries
    Replies: 2
    Last Post: 09-22-2015, 09:09 PM
  2. Replies: 1
    Last Post: 11-12-2013, 02:19 AM
  3. Find last used column address using vba
    By selvakumar.arc in forum Import/Export Data
    Replies: 2
    Last Post: 05-30-2013, 08:05 AM
  4. find out values between two dates column
    By learning_graccess in forum Queries
    Replies: 3
    Last Post: 04-20-2012, 04:17 AM
  5. Replies: 1
    Last Post: 01-22-2010, 03:21 AM

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