User Help > Displaying Items Meeting Specific Conditions > Creating a Query > Query Filters: Key Considerations
  
Query Filters: Key Considerations
When using query filters in a query, consider the following:
Query Filter
Notes
General Query Information
A named query can be edited by the user who created it. Principals (users and groups) that a named query is shared with can edit it if they have edit permissions assigned to them by the query creator. A named query can only be deleted by the user who created it or by the administrator.
You must give the query a name, but you do not have to give it a description or share it with groups.
To create or edit queries, you must have the CreateQuery permission assigned to you by your administrator.
Queries with several filters may take longer to run than queries with only one or two filters.
Your administrator defines states, ranges, and phases.
Your administrator defines custom fields you can query on, for example, Severity, Reviewed By, Root Cause, Lifecycle Phase. When specifying the conditions for a custom field, if the field is not mandatory you can choose to query on an empty value.
To include empty field values in your query, select the or is empty option. This option is only available for certain fields.
Queries that include fields not visible on specific types do not return items where the fields are not visible.
Attachment Filters
When specifying conditions for attachment fields:
Select the attachment field you want to query on from the data filter dialog box.
Select the attachment attribute you want to query on.
The list of fields you can select from is the list of fields in your database.
Branch Filters
If you do not have permission to view specific item types and/or their branches, branch filters do not display when modifying a query.
Text Filters
For text fields, type a word or phrase to search for In thefield namecontains field. Depending on the database, text field queries may be case sensitive (see your administrator for more information).
To query on empty text fields, leave the field namecontains field empty, and select the or is empty option.
By default, Windchill RV&S searches for items that contain all occurrences of words in a text string. For example, if you search for print option, Windchill RV&S may return only the items that contain print and option as separate words in a text field. To search for items that contain a complete text string, use double quotes, for example, “print option”.
Because dynamically computed fields are not stored in the database, dynamically computed short text fields cannot be located with an all text field search in the Windchill RV&S client. To search for dynamically computed short text fields, create a query that includes a specific “field contains” comparison. For more information about computed fields, see your administrator.
The Any Text Field filter is meant to return query results containing specific words in text fields, for example, “frequency”, “calculator”, and “hardware”. Common words, such as “the”, “this”, and “a”, are ignored; however, the filter in the Items view does accept common words, such as “the”.
To search for the literal word “OR” (all capitals), it must be surrounded by quotes, such as “Cat OR Dog” and Cat “OR” Dog.  If "OR" is quoted by itself, results are returned only if “OR” is not an excluded word in the text search configuration for your Windchill RV&S database.
* 
On Oracle, searching for “Cat OR Dog” returns results that contain “Cat” anywhere or contain “Dog” anywhere. When “OR” appears between two other words within the quoted text string, it treats the word as per its special reserved word meaning.
If the text specified for the Any Text Field filter is too generic, the query may stop because it consumes too many system resources.
Date Filters
For date fields, you can specify one of the following symbolic dates: Yesterday, Today, or Tomorrow. To set a specific date, select a date/time from the calendar when you click Lookup Date, or type a date/time using the MM/dd/yyyy HH:mm:ss format.
When specifying a date range in a query, all dates are treated as timestamps, converted to the time zone on the Windchill RV&S server, and then truncated to a date-only format. The resulting date-only format is then converted to a Structured Query Language (SQL) statement format on the Windchill RV&S server, and the query is run based on the time zone of the server. If the user defining the date range is not in the same time zone as the Windchill RV&S server, a day can be lost or gained at either end of the defined range. The rollback of dates can cause the query results to vary.
* 
The date range conversion does not cause any problems when the user is in the same time zone as the Windchill RV&S server.
For example, if theWindchill RV&S server is in the America/New_York time zone and the following query date range is defined by a user in Germany: Jan 1, 2009 to Jan 31, 2009.The final conversion of the date range is: Dec 31, 2008 06:00:00 AM GMT+01:00 to Jan 31, 2009 06:00:00 AM GMT+01:00.
To avoid any date rollbacks when working with query date ranges in Windchill RV&S, PTC recommends that users specify the time zone that is used by theWindchill RV&S server they are connecting to.
If your administrator configured date fields to display the time, you can include the time in date filters by selecting the Show Time option and a corresponding time from the calendar. Time is specified from 00:00:00 to 23:59:59 inclusive in 24 hour format; however, Windchill RV&S displays the time in 12 hour format. For example, specifying 13:56:45 displays the time as 1:56:45 PM.
Displayed date fields do not change based on the time zone a user operates in; however, displayed date/time fields and time entries vary based on the time zone a user operates in.
Symbolic dates are evaluated on the Windchill RV&S client’s time zone.
ID Filters
When specifying conditions to display live and versioned items by ID, you can:
display a specific live item only. For example, ID is = 123 returns 123.
display a live item and all versions of the item. For example,ID is = 123 and include versions is enabled returns 123, 123-1.0, 123-1.1, and 123-1.2.
display a range of live items. For example, ID is > 123 and < 128 returns 124, 125, 126, and 127.
display a specific versioned item. For example, ID is = 123–1.0 returns 123–1.0.
* 
You cannot display a range of versioned items. For example, ID is > 123-1.0 and < 123-2.0.
Document ID Filters
When specifying conditions to display content that is included in live and versioned documents, you can:
display the contents of a live document. For example, Document ID is = 123 and Is live returns content that is included in live document 123.
display the content from a range of live documents. For example, Document ID is > 123 and < 128 and Is live returns content that is included in live documents 124, 125, 126, and 127.
display the contents of a versioned document. For example, Document ID is = 123–1.0 returns content that is included in versioned document 123–1.0.
* 
You cannot display the content from a range of versioned documents, for example, Document ID is > 123-1.0 and < 123-2.0.
Label Filters
If you do not have permission to view specific item types and those types have associated labels, label filters do not display when modifying a query.
Searching on a blank label displays all items with labels you have permission to view.
Change Package Filters
If you do not have permission to view any change package types, change package filters do not display when creating a query.
Item Filters
Item filters are used to find specific content and document item types that operate in a document model defined by your administrator.
If document versioning is enabled, queries return all items (live and versioned) by default. To specify live or versioned items, include the Is live or Is versioned filter.
Workflow and Document Project Filters
For workflow and document project fields, only projects you have permission to view are listed. Your administrator defines project permissions.
Configuration Management Project Filters
You cannot query on configuration management project fields.
Relationship Filters
When specifying conditions for relationship fields:
In the Select the relationship field you wish to query on field, specify the relationship field that contains the related item.
To restrict your query to either backward or forward relationships, the backward option is automatically selected if you select Backward Relationships for the relationship field. The forward option is automatically selected if you select Forward Relationships for the relationship field. The forward option is also automatically selected for a custom relationship field. You cannot change these options.
Relationship flags are set up by your administrator as part of the definition for a relationship field. The list of fields you can select from is the list of fields in your database.
History (by value) Filters
You cannot query on attachment or source link fields.