MeanJoeGreen13
IS-IT--Management
- Jan 6, 2008
- 15
I posted this in SQL forum in error ... should be in Access forums (apologies ... still new to this site).
I use the following code to pull a list of customers who have placed an order for a particular product between two dates. However, if the customer has ordered this item more than once in the date period multiple records appear for the customer. How can I change the SQL to just show me one record per customer?
The SQL so far is:
I use the following code to pull a list of customers who have placed an order for a particular product between two dates. However, if the customer has ordered this item more than once in the date period multiple records appear for the customer. How can I change the SQL to just show me one record per customer?
The SQL so far is:
Code:
SELECT Customers.Title, Customers.[First Name], Customers.[Last Name], Customers.Address1, Customers.Address2, Customers.Town, Customers.County, Customers.Postcode, Customers.Country, Sales.[Sales Date], Sales.[Sales Date], SalesD.[Item Code]
FROM Customers INNER JOIN (Sales INNER JOIN SalesD ON Sales.SalesID = SalesD.SalesID) ON Customers.ID = Sales.CustomerID
WHERE (((Sales.[Sales Date])>=#10/1/2007# And (Sales.[Sales Date])<=#10/31/2007#) AND ((SalesD.[Item Code])="BA0002"));