Custmer Qurry? How Do I ?

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

Guest

Hi

I am trying to get the IDs of all those customers who have not purchased
anything in the last 3 months. What SQL query do I use? The table has 2
columns: CustomerID and PurchaseDate.


Many thanks
 
I assume you have Customer table, using a sub query you can achieve that

Select * From CustomersTable Where
CustomerID Not In (Select CustomerID From PurchaseTable
Where PurchaseDate > DateAdd("m",-3,Date()))
 
Hi

I am trying to get the IDs of all those customers who have not purchased
anything in the last 3 months. What SQL query do I use? The table has 2
columns: CustomerID and PurchaseDate.

I presume you also have a Customer table? If so, that will be needed:

SELECT Customers.CustomerID, <other fields as needed>
FROM Customers
WHERE NOT EXISTS
(SELECT CustomerID FROM yourothertable
WHERE PurchaseDate > DateAdd("m", -3, Date()));

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top