Access 2000

B

Binxy79

i have a table for orders and customers. i need to do a query for the
customers who have not placed an order in the last 365 days.
 
J

John Vinson

i have a table for orders and customers. i need to do a query for the
customers who have not placed an order in the last 365 days.

A "Not Exists" subquery will do the trick here:

SELECT Customers.*
FROM Customers
WHERE Not Exists
(SELECT CustomerID FROM Orders
WHERE Orders.CustomerID = Customers.CustomerID
AND SaleDate >= DateAdd("yyyy", -1, Date());


John W. Vinson[MVP]
 
Top