Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    513

    simple insert into without dups syntax (?)


    trying to write a simple SQL to add records from a source table <exp_manufacturers> to a target table <manufacturers> without duplicating records in <manufacturer>; and (I'm sure it's obvious... but) I'm stuck in syntax error...


    insert into Manufacturers (ManufacturerName,"Web Site", TelephoneNumber, Email, PrimaryCatagory) select Manufacturer, WebSite, TelephoneNumber, Email, PrimaryCatagory from (exp_manufacturers) where Manufacturers.ManufacturerName not in (exp_Manufacturers.Manufacturer from exp_Manufacturers);


    many thanks in advance
    mark

  2. #2
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    Insert Into Manufacturers (ManufacturerName,"Web Site", TelephoneNumber, Email, PrimaryCatagory) Select Manufacturer, WebSite, TelephoneNumber, Email, PrimaryCatagory From exp_manufacturers Left Join Manufacturers On exp_manufacturers.Manufacturer = Manufacturers.ManufacturerName
    Where Manufacturers.ManufacturerName Is Null

  3. #3
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    513
    thanks...

    with a few minor adjustments... (ambigous refference to field names common to both tables)
    perfect

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

Similar Threads

  1. Syntax Error: Insert Into statement in VBA
    By Kimbertha in forum Programming
    Replies: 1
    Last Post: 07-24-2012, 05:02 PM
  2. INSERT INTO Syntax Error
    By eww in forum Programming
    Replies: 1
    Last Post: 04-06-2011, 10:28 AM
  3. Insert INTO syntax help
    By jpkeller55 in forum Access
    Replies: 3
    Last Post: 02-27-2011, 03:38 PM
  4. Combine insert into syntax
    By Cojack in forum Queries
    Replies: 1
    Last Post: 09-22-2010, 07:48 AM
  5. Syntax Error In Insert Into Statement
    By frankvfox in forum Queries
    Replies: 1
    Last Post: 09-09-2008, 12:35 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