Total Records

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

Guest

I have 2 tables, one that contains customer info such as name, address etc.
and the second table contains customer's purchase history. The tables are
linked via customer id. I am trying to create a query that gives me all
customers with more than 3 purchases. Any suggestions! Thanks.
 
SELECT tblCustomer.CustomerID, tblCustomer.CustomerName,
Count(tblOrder.OrderNumber) AS CountOfOrderNumber
FROM tblCustomer INNER JOIN tblOrder ON tblCustomer.CustomerID =
tblOrder.CustomerID
GROUP BY tblCustomer.CustomerID, tblCustomer.CustomerName
HAVING (((Count(tblOrder.OrderNumber))>3));
 

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