There are a couple of techniques to doing this.
1. A setting change that will send one query down to the database.
2. You feed the query to two local queries -- Master and Detail. This local processing forces only one query, and in one of the rare case...
1. A setting change that will send one query down to the database.
2. You feed the query to two local queries -- Master and Detail. This local processing forces only one query, and in one of the rare case...