Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6167839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:34:55+00:00 2026-05-23T22:34:55+00:00

I am working for a client who gets data in Excel spreadsheets but wants

  • 0

I am working for a client who gets data in Excel spreadsheets but wants to import the data into an Access table. The fields for the data records are:

-InvoiceNum
-InvoiceDate
-Customer
-ShipDate
-Quantity
-Item
-PriceEach

He receives data twice per month, and each time he receives data, he wants to be able to import the data into a table in Access.

There are two issues that are causing me a problem: 1) There is no primary key for the data (the closest field to a primary key is “InvoiceNum”, but unfortunately multiple records can have the same string for this field); 2) Duplicate records are possible, where by “duplicate records” I mean two records that have the same values for each field.

The problem is that we do not want duplicate records in the data table.

I don’t know what is the best way to handle this. I am hoping for some suggestions concerning the following:

a) Should I store all the records in an Excel spreadsheet that is linked to the Access table? I was thinking that if I do this, then I can append each new set of data to this spreadsheet (including duplicates), then write a macro in Excel to remove duplicates (I noticed I can do this by using the “Remove Duplicates” command on the “Data” tab).

or

b) Should I store the data directly in the Access table? I can write some VBA program or a macro to import each new set of Excel data to the Access table, but is there a way to do this importing that can eliminate duplicates (again, there is no primary key in the table)?

or

c) Is there another option that is better than the other two above?

Thanks for any help with this! I really appreciate it!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:34:57+00:00Added an answer on May 23, 2026 at 10:34 pm

    If you can’t do what @Catcall suggests (i.e., fix the process that produces the dupes), I’d do it this way:

    • create a staging table in Access. It’s function is just to be a buffer table for each import, and is cleared after use.

    • import into it using the method @HansUp provided (i.e., a SQL string with the connect string in the IN clause).

    • then use a query with a LEFT JOIN to the existing invoices to find the ones that are new:

          SELECT tblBuffer.InvoiceNum, tblBuffer.InvoiceDate, tblBuffer.Customer, tblBuffer.ShipDate, tblBuffer.Quantity, tblBuffer.Item, tblBuffer.PriceEach 
          FROM tblBuffer LEFT JOIN tblInvoices 
            ON tblBuffer.InvoiceNum = tblInvoices.InvoiceNum
          WHERE tblInvoices.InvoiceNum Is Null

    That will give you the new invoices, and you can easily turn that into an INSERT command to insert those records:

          INSERT INTO tblInvoices (InvoiceNum, InvoiceDate, Customer, ShipDate, Quantity, Item, PriceEach)
          SELECT tblBuffer.InvoiceNum, tblBuffer.InvoiceDate, tblBuffer.Customer, tblBuffer.ShipDate, tblBuffer.Quantity, tblBuffer.Item, tblBuffer.PriceEach
          FROM tblBuffer LEFT JOIN tblInvoices 
            ON tblBuffer.InvoiceNum = tblInvoices.InvoiceNum
          WHERE tblInvoices.InvoiceNum Is Null
    • Now, it does occur to me given the field names that the reason there many be duplicate invoices is because this is denormalized data, and the cases where there’s more than one record are actually any invoice with more than one invoice item. In that case, you may need to create an invoice header table and then insert the invoice items into an invoice details table. I’ll leave that as an exercise to the reader, since it’s too much work to mock it up in the abstract when it may not even matter.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with a client who wants to mix LINQ to SQL with their
I'm working for a client who installed WordPress on his server. But it doesn't
I'm working with a client who wants to add timestamps to a bunch of
I'm working with a client who has just upgraded from SQL 2000 to SQL
I am currently working for a client who are petrified of changing lousy un-testable
I am working on a client server system, and am running into issues where
I've got a working SOAP::Lite client. It works against an established server, but so
We are presently working for a client who is new to working with distributed
I have a client who wants to send gift certificates to people who sign
I'm working with client who provided me with somewhat vague instructions. Here's what I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.