Call a Query from another Query in Query Designer?
In MS Access I could have a 2nd Query refernce the first Query.
In Query Designer in Studio 2005, I see no way of doing this
ie: Query 2 gets all or some of it's data from Query 1
In my 2005 Project, Under Queries, I have a Query 1 and a Query 2.
How do I access with Query 2 what Query 1 returns?
(i have it sort of working with the "make table" option on Query 1, but I dont want to clutter up the DB with temp tables!)
Any help?
Thx!
Carl
[464 byte] By [
Zep--] at [2007-12-16]
You can do this in the Select statement.
For example, the following will list all customers who placed an order in 1996
SELECT Distinct Customers.CompanyName
FROM Orders INNER JOIN
Customers ON Orders.CustomerID = Customers.CustomerID
WHERE (Customers.CustomerID IN
(SELECT CustomerID
FROM Orders AS Orders_1
WHERE (DatePart(Year, OrderDate) = 1996)))
Does this help?
Robert