Results 1 to 7 of 7
  1. #1
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409

    query with two kind of join


    hi
    here there is a db with a query called don't open on design (the name is relevant) in which i select the records in the two tables that have same name and one of the two fields (connected on_1=connesso il OR connected on_2=connesso il_2)

    now, i'd like to add another join, the fields "position" and "company" must be different at least for one of them
    how can i do that?

    thanks
    Attached Files Attached Files

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    think you need to provide some example data to illustrate what you mean

    otherwise, why not just use criteria?

  3. #3
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    in the image you can see an example.
    the highlited row is the result i want
    the "name" is the same, one of the field between "position" or "company" are not the same, and one of the field "connected on_1" or "connected on_2" are the same
    Click image for larger version. 

Name:	Cattura.PNG 
Views:	13 
Size:	9.3 KB 
ID:	43380

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    so like I said use a criteria

    Code:
    SELECT LK_contatti.[Nome cognome], LK_contatti.Position, LK_contatti.Company, LK_contatti.[Connected On_1], LK_contatti.[Connected On_2], [LK contatti_messaggi TOT UNICI LOCALE].[Nome cognome], LK_contatti.Company, [LK contatti_messaggi TOT UNICI LOCALE].Position, [LK contatti_messaggi TOT UNICI LOCALE].Company, [LK contatti_messaggi TOT UNICI LOCALE].[Connesso il], [LK contatti_messaggi TOT UNICI LOCALE].[Connesso Il_2]
    
    FROM LK_contatti INNER JOIN [LK contatti_messaggi TOT UNICI LOCALE] ON LK_contatti.[Nome cognome] = [LK contatti_messaggi TOT UNICI LOCALE].[Nome cognome]
    
    WHERE ((([LK contatti_messaggi TOT UNICI LOCALE].Position)=[LK_contatti]![Position]) AND (([LK contatti_messaggi TOT UNICI LOCALE].Company)<>[LK_contatti]![Company])) OR ((([LK contatti_messaggi TOT UNICI LOCALE].Position)<>[LK_contatti]![Position]) AND (([LK contatti_messaggi TOT UNICI LOCALE].Company)=[LK_contatti]![Company])) OR ((([LK contatti_messaggi TOT UNICI LOCALE].Position)<>[LK_contatti]![Position]) AND (([LK contatti_messaggi TOT UNICI LOCALE].Company)<>[LK_contatti]![Company]))
    your example result required does not match the data supplied, so I'm guessing this is what you require

  5. #5
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    it is very nice, just what i needed. I thought only to join, not criteria.

    maybe if possible i'd like another criteria, the field "sender profile url": the name OR the sender profile url should match. Is it possible?

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    yes - but your requirement is not clear as to how to implement - if a different query then do much the same thing as per my suggestion but with these other fields. Alternatively if you mean to return these others as well then in the existing query grid, add as new rows in the criteria grid below the existing rows.

  7. #7
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    yes i figured it out thanks.
    maybe it's fine this solution, linkedin data are not so good

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

Similar Threads

  1. Some kind of crosstab query: part4
    By FL0XN0X in forum Access
    Replies: 16
    Last Post: 03-18-2018, 04:51 PM
  2. Some kind of Crosstab Query (part2)
    By FL0XN0X in forum Access
    Replies: 3
    Last Post: 02-18-2018, 04:13 AM
  3. Unmatched Query (Kind of)
    By lzook88 in forum Queries
    Replies: 5
    Last Post: 12-23-2015, 12:49 PM
  4. Some kind of lookup query
    By borge in forum Queries
    Replies: 1
    Last Post: 10-16-2011, 03:13 PM
  5. What kind of query do I need?
    By cowboy in forum Queries
    Replies: 1
    Last Post: 02-17-2010, 04:09 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