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

    query no duplicates - multiple fields


    EDIT sorry the title should be "query not matching records", i can't change title
    -------------------------------------------------------------


    hi, i made this very complex (to me) sql


    Code:
    SELECT [LK Contatti_messaggi_totali].[Nome cognome], [LK Contatti_messaggi_totali].Position, [LK Contatti_messaggi_totali].Company, [LK Contatti_messaggi_totali].CittàID, [LK Contatti_messaggi_totali].Mercato, [LK Contatti_messaggi_totali].Settore, [LK Contatti_messaggi_totali].Contratto, [LK Contatti_messaggi_totali].[Connesso il], [LK Contatti_messaggi_totali].[Data invio], [LK Contatti_messaggi_totali].Subject, [LK Contatti_messaggi_totali].Content, [LK Contatti_messaggi_totali].Folder, [LK Contatti_messaggi_totali].[Da contattare il], [LK Contatti_messaggi_totali].[Non interessante], [LK Contatti_messaggi_totali].[In db]FROM [LK Contatti_messaggi_totali] LEFT JOIN [LK contatti_messaggi TOT UNICI LOCALE] ON (([LK Contatti_messaggi_totali].Position = [LK contatti_messaggi TOT UNICI LOCALE].Position) OR ([LK Contatti_messaggi_totali].Company = [LK contatti_messaggi TOT UNICI LOCALE].Company) OR  ([LK Contatti_messaggi_totali].[Connesso il] = [LK contatti_messaggi TOT UNICI LOCALE].[Connesso il])) AND ([LK Contatti_messaggi_totali].[nome cognome] = [LK contatti_messaggi TOT UNICI LOCALE].[nome cognome])
    WHERE ((([LK Contatti_messaggi_totali].Position) Is Not Null) AND (([LK Contatti_messaggi_totali].Company) Is Not Null) AND (([LK contatti_messaggi TOT UNICI LOCALE].[Nome cognome]) Is Null) AND (([LK contatti_messaggi TOT UNICI LOCALE].Position) Is Null) AND (([LK contatti_messaggi TOT UNICI LOCALE].Company) Is Null));
    i want to select every record in [LK Contatti_messaggi_totali] table that has no match in [LK contatti_messaggi TOT UNICI LOCALE] by the formula: [nome cognome] AND (position OR Company OR Connesso il)

    so i have every record in [LK Contatti_messaggi_totali] not matched in [LK contatti_messaggi TOT UNICI LOCALE] by the Name AND one of the following fields: Position, company, connesso il

    is it right?

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,991
    Have you tried using the unmatched query wizard. It should make this much easier
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    sure, but i can't use the criteria i used....(criteria 1) AND (criteria2 or criteria3 or criteria4)

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,991
    Start with the wizard then modify the design manually
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    thanks, i made it in this way, but ony with design view i didn't manage to reach my goal

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

Similar Threads

  1. Query Multiple Tables Without Duplicates
    By pooldead in forum Queries
    Replies: 2
    Last Post: 08-13-2019, 09:36 AM
  2. Hide Duplicates in a Query Across Two Fields
    By ItsRoland in forum Queries
    Replies: 4
    Last Post: 04-01-2019, 01:53 PM
  3. Replies: 3
    Last Post: 02-20-2017, 08:27 AM
  4. Replies: 5
    Last Post: 05-06-2015, 09:36 PM
  5. Replies: 2
    Last Post: 10-03-2014, 11:57 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