Is the date issued your latest document date? or if is any other date like create date you can use distinct and max
Here is an example using the customers and orders table in Northwind Database
SELECT DISTINCT Customers.CustomerID, Customers.CompanyName, Customers.City, Customers.Country, Max(Orders.OrderDate) AS MaxOfOrderDate
FROM Customers RIGHT JOIN Orders ON Customers.CustomerID = Orders.CustomerID
GROUP BY Customers.CustomerID, Customers.CompanyName, Customers.City, Customers.Country
HAVING (((Max(Orders.OrderDate)) Between #1/1/1997# And #12/31/1997#));
|