[Applies to: Microsoft Dynamics CRM 4.0]
Find the latest SDK documentation: CRM 2015 SDK
A query expression is used to programmatically build a query that contains data filters and search conditions that define the scope of a database search. A query expression is used for single-object searches, for example, to search for all accounts that match certain search criteria. A query expression is a strong typed (object based) approach to building queries that can be executed. The QueryBase class is the base class for query expressions. There are two derived classes: QueryExpression and QueryByAttribute. The QueryExpression class supports complex queries. The QueryByAttribute class is a simple means to search for entities where attributes match specified values.
Query expressions are used in methods that retrieve more than one entity instance such as the RetrieveMultiple method and in messages that perform an operation on a result set specified by a query expression such as the BulkDelete message.
Another way to build queries is to use FetchXML, the proprietary Microsoft Dynamics CRM query language.
In This Section
Lists all messages that use a query expression.
Learn to use the QueryByAttribute class to specify a simple query.
Discover the QueryExpression class to specify a more complex query.
Describes how to use the ColumnSet class to specify which columns to return from a query.
Contains information about the ConditionExpression class to specify a condition.
Learn to use the FilterExpression class to specify a complex filter for a query.
See how to test for a null value in a query.
Describes how to use intersect tables.
Determine how to use the paging cookie.
Describes how and when to use the FetchXML query language.
Describes the updated aggregation behavior using count.
Contains sample code that show how to create queries.