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

    append Query - no duplicates

    Hi,
    this is a very sensitive operation for me so i'm asking to be sure, i found some solution but i'm not so sure about that


    i have a LOCAL TABLE
    name/position/company/City/market/Sector/contract/connected on/message date/subject/content/folder/to contact in/not in db/not interesting
    this table was created adding fields to the exportation of linkedin data


    now i'd like to import other data from linkedin and add that people to my LOCAL TABLE that i have not already imported. the structure of LINKEDIN IMPORT (a query that i built to merge all data from linkedin) is this
    name/position/company/connected on/message date/subject/subject/folder




    the question is:
    i want to check by name and position if i have already in my LOCAL TABLE this person, and if not add it. other issue, if i have already this person but the message date field in my LOCAL TABLE has no date in it or a date less recent, i'd like to add the date message from my LINKEDIN DATA.

    is it possible?
    i have a database too but there is name of linkedin contacts, i dunno if it's ok , if it is i can attach it

  2. #2
    Join Date
    Apr 2017
    Posts
    1,679
    You need to run 2 queries - an Append query, and an Update query. Like
    Code:
    INSERT INTO YourLocalTable (Name, Position, Company, ConnectedOn, MessageDate, Subject, Folder)
    SELECT lin.*
    FROM
         YourLinkedinTable lin (LEFT JOIN YourLocalTable loc ON loc.Name = lin.Name AND loc.Position = lin.Position)
    WHERE loc.Name Is Null
    
    UPDATE YourLocalTable
    SET MessageDate = lin.MessageDate
    FROM
         YourLinkedinTable lin (LEFT JOIN YourLocalTable loc ON loc.Name = lin.Name AND loc.Position = lin.Position)
    WHERE loc.MessageDate Is Null AND lin.MessageDate Is Not Null

  3. #3
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    looks like the solution, but what is "lin"?

  4. #4
    Join Date
    Apr 2017
    Posts
    1,679
    Quote Originally Posted by diegomarino View Post
    looks like the solution, but what is "lin"?
    An alias for YourLinkedinTable.

  5. #5
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    Quote Originally Posted by ArviLaanemets View Post
    An alias for YourLinkedinTable.
    sorry, dumb question

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

Similar Threads

  1. Update and Append Query with duplicates
    By j4rmmbll in forum Queries
    Replies: 5
    Last Post: 06-05-2018, 06:32 PM
  2. Exclude duplicates append query
    By rayted in forum Queries
    Replies: 5
    Last Post: 03-05-2018, 10:17 AM
  3. Append Query to a table (Without Duplicates)
    By cmorten in forum Queries
    Replies: 12
    Last Post: 11-28-2016, 02:44 PM
  4. Append query without duplicates using two id's
    By sdel_nevo in forum Queries
    Replies: 2
    Last Post: 02-20-2015, 08:25 AM
  5. Append query creating duplicates
    By dhicks19 in forum Queries
    Replies: 1
    Last Post: 05-14-2012, 06:36 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