There are various scenarios when subqueries are useful.
- When the results of the main query are dependent upon the results of the inner query.
- When the value of the operand is unknown.
- When the query filter for the report involves a value that changes over time.
Like combined queries, subqueries are always built in the Query Panel .
When creating a subquery, process the inner query first so that the result set can be passed to the main query.
You construct a subquery by placing a query filter on one of the objects in the main query and then using the operand for that query filter to launch the subquery. The operator you include in the query filter determines the relationship between the data sets returned by the inner and outer queries.