A query within a query is called a subquery. Here's an introductory article:
How to Create and Use Subqueries
at:
http://support.microsoft.com/?id=209066
If that gets too complex, and your final query still needs to use other
queries as input "tables", you can create the query statement you need for
the lower level query, and assign it to the SQL property of the QueryDef.
For example, if your final query uses Query1 as a table, you can use:
Dim db As DAO.Database
Dim strSql As String
Set db = CurrentDb
strSql = "SELECT * FROM Table2;"
db.QueryDefs("Query1").SQL = strSql
db.Exeute "Query2", dbFailOnError
For an explanation of why you might prefer the Execute method rather than
RunSQL, see:
Action queries: suppressing dialogs, while knowing results
at:
http://allenbrowne.com/ser-60.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"thread" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> I need to build dinamic query but this query is based on 3 queries on
> the way before reaching to this query
> does anyone have an example of a query inside of a query?
> i have a table that have data of some groups
> there is a query for seperate group.
> then all the groups query are build merged and making one query that
> proccessing data from all of these groups
> and last query that building a table from this proccessed query
> i would like to make my database dynamic and not limit my groups