This query generates a table of customer id’s:
SELECT Transactions.customerId
FROM Transactions
WHERE Transactions.purchaseDate <#9/1/2012#
GROUP BY Transactions.customerId
HAVING Sum(Transactions.amountPaid)<>0;
This query generates a table of transactions:
SELECT Customers.firstName, Customers.lastName, Transactions.transactionId, Transactions.product, Transactions.purchaseDate, Transactions.amountPaid, Customers.customerId
FROM Customers INNER JOIN Transactions ON Customers.customerId = Transactions.customerId
WHERE (((Transactions.refundTransaction)=False));
I want to select all of the transactions (second query) from only users generated by the first query.
Using MS Access, it is possible to save both of these queries and then add them by query name to the query design window. Once added, you can create an INNER JOIN between the two queries by dragging and dropping the relevant field name from one to the other. The next stage, if you can to move on, is to substitute the query name for a derived table, that is, the sql content of the query.
For example:
Query1
Query2
Query3
Substituting: