Hi Kevin,
You do not need or want the tblCust5. Use one query to get the customers
had more than X invoices ( I used the number 3).
Reference that query to get all the invoices or the total cost, etc.
Query examples are below. You can paste them into the design panel.
' This query gives you all the Customers with more than 3 invoices
' in Dec 2009
SELECT tblCustInv.CustNo
FROM tblCustInv
WHERE (((Month([InvDate]))=12) AND ((Year([InvDate]))=2009))
GROUP BY tblCustInv.CustNo;
' This uses the above query results and gives you all the invoices for
' all the customers who had more than 3 invoices in 12/09
SELECT tblCustomers.CustNo, tblCustInv.InvoiceNo, tblCustInv.InvDate,
Month([InvDate]) AS InvMonth, Year([InvDate]) AS InvYear
FROM (tblCustInv RIGHT JOIN qryGrtThan3 ON tblCustInv.FKCustNo =
qryGrtThan3.FKCustNo) LEFT JOIN tblCustomers ON qryGrtThan3.FKCustNo =
tblCustomers.CustNo
WHERE (((Month([InvDate]))=12) AND ((Year([InvDate]))=2009));
Regards
Kevin
Kevin199 said:
I have a table (tblCustInv) with customer numbers and invoice numbers.
Monthly, I make another table (tblCust5) with only customers with 5 or
more
invoices. I would like to make tblCust5 using a query or code. It would
save a lot of time as there are over 10,000 records in tblCustInv and 1200
in
tblCust5. Any suggestions would be great.