About using the database to get informations.

  • Thread starter Thread starter Stefano
  • Start date Start date
S

Stefano

Hi everybody,
I have a question about how to do a simple
operation. I have a table with data classified by
requests, every record is a single request my company got.
Now I would just like to have a table, or a dataset, with
just the customers list, so that if a single customer made
us different requests all the duplicated are eliminated
and I just have a sheet with customer's name, address,
contacts and so on, without useless repetitions. Thanks
 
Probably the easiest thing to do would be to create a new
table for your customer info, including a unique
customerID. Then add the customerID field to the request
table as a foreign key to the customer table.
 
Hi Stefano -

Create a query to retrieve the data from that table that you want. While in
the query's design view, open the query properties (right-click in an open
grey area of the upper pane and choose Properties...). Change the Unique
Values property to Yes. Now only one record per customer should appear. (The
equivalent SQL syntax is to add the keyword DISTINCT directly after your
SELECT keyword.)

A BIG CAVEAT:
If you are storing your customer info along with each request, and some of
the customer info varies from record to record, each record that differs
will be listed separately. This will require either data cleanup, or
preferably normalization of your tables which is a much bigger topic than
this message.
 
Back
Top