Hi JR
Let's assume you have the following:
1. Stock items, uniquely identifiable by stock number
2. Customers, uniquely identifiable by customer number
3. Orders, uniquely identifiable by order number
Each of these entities must be represented by a separate table in your
database, each with its respective unique number as a primary key. As
each customer may place multiple orders, you will need a one-to-many
relationship between Customers and Orders.
Assuming an order may comprise several items, you must also have a fourth
table for "OrderItems". This table will have fields for order number,
stock number, unit price, quantity, discount, etc.
How you handle the import of external data depends very much on what is
contained in your Excel files, but one thing is clear: your import
procedure must not create duplicates. In any of your three base tables.
The first step should be to check the import data to ensure that there are
no stock numbers which do not already exist in your table. If any are
found then an alert should be raised, and the problem rectified before the
process can continue. Presumably you can't sell something you don't know
about!
The next step should be to scan the data for new customers which do not
already exist in the Customers table, and add them to that table.
Finally, you need to add new Orders and their related OrderItems.
I'm sorry if I'm suffering from a huge misunderstanding here, but I can't
see how you should be creating and duplicates that need to be deleted.
Please can you post back with information on (a) the basic structure of
your tables and relationships and (b) the columns in your import data.
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
JR said:
I would still need the query.
A little more: I get reports of daily activity once a week. stock
numbers
may be ordered more than once a day or by more than one customer. By the
end
of the week there are multiple occurances of the stock numbers. Data
come in
in excel, get imported to access. Individual orders can not be deleted
just
because the stock number shows up more than once.
This seems about as hopeless as the Microsoft "help" on the subject.
Graham Mandeno said:
Hi JR
Can the external data not be pre-processed to deal with the problems
before
importing it into your main table(s)?
It seems to me a much better idea not to import the duplicates in the
first
place.
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
I get large amounts of data that have to be processed from sources
external
to my organization.
Often the data is composed of stock numbers and how many orders per
unit
of
time were made against the stock numbers. So the stock numbers show
up
time
after time.
At the same time information about physical characteristics of the
items
the
stock numbers represent is maintained in a separate table because not
everyone enters correct basic data (such as weight and cube) so the
"official" weight and cube has to be maintained.
Because other data (not stock numbers) in the same record as the stock
numbers are not consistant you can wind up with the same stock number
showing
up more than once due to the differint column data. This is usually
the
cause of duplicate stock numbers.
It goes on and on ... Fact is that duplicate stock numbers show up
consistantly.
:
If you'll describe the situation which causes the need to "do this
time
and
again", folks here may be able to offer suggestions that could reduce
or
eliminate that need.
Regards
Jeff Boyce
Microsoft Office/Access MVP
Looking for a query that will eliminate duplicates from a SINGLE
table.
Will
have to do this time and again so manually eliminating from a find
duplicates
query, while workable, is not a good solution.
Anyone know how to (the help from Microsoft on this is 18 pages
long
and
makes my head hurt before the bottom of the first page).
Thanks!