Eliminate Duplicates?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good morning.
I have a customer database that I wish to print labels for.
The thing is, I wish to only view unique records. I've got two tables. One
customersTbl names and address. The second of customershistoryTbl. When I
create the query, using from customersTbl, name, address, city, state zip and
from customerhistoryTbl where datebegan is not null I get multiple records.
I only want to see unique - can anybody help?
 
You can use an aggregate query (Totals or Group By) and just sort on the
date field and choose Min (which will give you the first date.
 
Here is my query

SELECT Customers.ContactFirstName, Customers.ContactLastName,
Customers.BillingAddress, Customers.City, Customers.Zip,
CustomerHistory.[Date Run Began]
FROM Customers INNER JOIN CustomerHistory ON Customers.CustomerID =
CustomerHistory.CustomerID
WHERE (((CustomerHistory.[Date Run Began]) Is Not Null));

I dont understand what you're telling me.
where do i put group by and how do I choose Min?
 
Here is my query

SELECT Customers.ContactFirstName, Customers.ContactLastName,
Customers.BillingAddress, Customers.City, Customers.Zip,
CustomerHistory.[Date Run Began]
FROM Customers INNER JOIN CustomerHistory ON Customers.CustomerID =
CustomerHistory.CustomerID
WHERE (((CustomerHistory.[Date Run Began]) Is Not Null));

I dont understand what you're telling me.
where do i put group by and how do I choose Min?



Arvin Meyer said:
You can use an aggregate query (Totals or Group By) and just sort on the
date field and choose Min (which will give you the first date.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

- Show quoted text -


Try this

SELECT Customers.ContactFirstName, Customers.ContactLastName,
Customers.BillingAddress, Customers.City, Customers.Zip,

MIN(CustomerHistory.[Date Run Began])

FROM Customers INNER JOIN CustomerHistory ON Customers.CustomerID =
CustomerHistory.CustomerID
WHERE (((CustomerHistory.[Date Run Began]) Is Not Null))

GROUP BY
Customers.ContactFirstName, Customers.ContactLastName,
Customers.BillingAddress, Customers.City, Customers.Zip


Regards
Andrew
 
Assuming you are using the query design view, open your query (in design
view), click on the Totals button (the greek sigma character), and use
Minimum instead of Group By for that one field.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Tammy said:
Here is my query

SELECT Customers.ContactFirstName, Customers.ContactLastName,
Customers.BillingAddress, Customers.City, Customers.Zip,
CustomerHistory.[Date Run Began]
FROM Customers INNER JOIN CustomerHistory ON Customers.CustomerID =
CustomerHistory.CustomerID
WHERE (((CustomerHistory.[Date Run Began]) Is Not Null));

I dont understand what you're telling me.
where do i put group by and how do I choose Min?

Arvin Meyer said:
You can use an aggregate query (Totals or Group By) and just sort on the
date field and choose Min (which will give you the first date.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Back
Top