Filter statements
Filter statements in queries must evaluate as true to include items in the results. Various operators are supported, but parentheses for order of operations are not.
A query includes filter statements. A filter statement must evaluate as true, or the item will not be included in the query results. Filter statements can use different operators, which are described in the following sections. Parentheses to indicate order of operation are not supported in query() calls.
Comparison between two fields is not supported by ZOQL.
Operators
The supported operators are explained in the following table. When the conditions are met, the expression evaluates as true and the item is included in the query results. See Field Types for more information about the field types used in Zuora.
Operators supported by data types
Using Null
You can use null as a value in a filter statement; for example, to find all accounts with a purchase order number, you might use the following statement:
You cannot use null on date-type custom fields in filter statements.
Reserved and escaped characters
You cannot use either the single quotation mark (’) or the backslash character () as string values in your queries without using a special character to indicate that they are part of your search and not a command or the end of a string. If you need to use them, you must place a backslash before them. (They are then called escaped characters.)
In the following example, where there is an apostrophe in the name, a backslash has been used to indicate that this is part of the search and not the end of the string:
In addition, you can use the following escaped characters:
Using wildcards within Like statements
You can use the percent ( % ) and underscore ( _ ) characters as wildcards in patterns within like statements:
- Percent (
%): Represents zero, one, or multiple characters. It can be used only once in each query, either at the beginning or end of the pattern. - Underscore (
_): Represents a single character. It can be used multiple times and in any position within the pattern.
The following table lists common wildcard use cases and the corresponding matching value examples: