Choosing Selection Criteria

You define selection criteria to selectively retrieve the data that you want. Selection criteria refine your query by specifying conditions that the retrieved data must meet. For example, you can specify that the system retrieve only those phone numbers with a certain area code instead of all phone numbers.

Because your PeopleSoft database stores data in tables, you can identify every individual piece of data by saying what column (field) and row (record) it is in. When you create a query, select the data that you want by specifying which columns and rows you want the system to retrieve.

If you run the query after selecting the fields, the system retrieves all the data in those columns; that is, it retrieves the data from every row in the table or tables. This might be much more data than you want or need. You select which rows of data you want by adding selection criteria to the query.

The selection criteria serves as a test that the system applies to each row of data in the tables that you are querying. If the row passes the test, the system retrieves it; if the row does not pass, the system does not retrieve it. For example, suppose that you needed the names of all PeopleStore customers who were not PeopleSoft employees. You would start by creating a query that retrieved the Name and Company fields from the Customer table. You could then add a selection criterion that enables PeopleSoft Query to scan for rows where the company name is not PeopleSoft.

In most cases, a selection criterion compares the value in one of a row’s fields to a reference value. In the preceding example, you would compare the value in the Company field to the constant value PeopleSoft. In other situations, you might compare the value to the value in another record field or to a value that the user enters when running the query.