Partager via


Having Dialog Box

Specifies conditions for selecting which groups of records to include in query output.

The Having dialog box appears when you choose Having in the Group By Tab, Query and View Designers.

  • Field Name
    Specifies a function, field name, or other expression. When creating a Having clause, select the field to display a list of functions, a list of field names for each table, or use the expression command to display the Expression Builder dialog box. If you choose a function, a submenu displays a list of field names available to use with that function.

  • Not
    Reverses the comparison criterion.

  • Comparison criterion
    Specifies the operator for the selection criterion. The comparison criteria are as follows:

    • Equal (=)   Specifies that field and the value in the Example field have the same value.

    • Like   Specifies that the field must include characters that match characters in the text in the Example field.

      For example, Customer.state Like O matches records from Ohio, Oklahoma, and Oregon.

    • Exactly Like (==)   Specifies that the field must match, character for character, the text in the Example field.

    • Greater Than (>)   Specifies that the field must be more than the value in the Example field.

    • Less Than (<)   Specifies that the field must be the same or less than the value in the Example field.

    • Greater Than or Equal To (>=)   Specifies that the field must be the same or more than the value in the Example field.

    • Less Than or Equal To (<=)   Specifies that the field must be the same or less than the value in the Example field.

    • Is NULL   Specifies that the field must contain a null value.

    • Is True   Specifies the left field or expression evaluates to True, assuming the field or expression evaluates to a logical value.

    • Between   Specifies that the field must be greater than or equal to the lower value, and less than or equal to the higher value, in the condition appearing in the Example column. You must separate the two values in the Example column with the word AND. Visual FoxPro creates the query with the word BETWEEN.

      For example, Invoices.idate Between 05/10/97 AND 05/12/97 matches records for the 10th, 11th, and 12th of May, 1997.

    • In   Specifies that the field must match one of several values in the comma-separated list appearing in the Example field.

      For example, Customer.name In Al,George,Mary matches records in which the customer's name is Al, George, or Mary.

  • Example
    Specifies the value or text with which you want to compare the field. To match the text casing of the example, use the UPPER( ), LOWER( ), and PROPER( ) functions.

  • Logical
    Adds an AND or OR condition to the list of conditions.

  • Pri. (Priority)
    Specifies a number ranging from 0 to 99, which indicates the priority for logical operations. The number 0 indicates the highest priority, while the number 99 indicates the lowest priority.

    Setting priorities for logical operations determines the order in which logical operations are performed and uses parentheses (()) for grouping operations. For example, suppose you specify a priority of 0 for a logical operation, a priority of 1 for a second logical operation, and a priority of 0 for a third logical operation. The first and third logical operations, which have a priority of 0, are performed before the second logical operation, which has a priority of 1.

  • Insert
    Inserts a blank row above the selected condition.

  • Remove
    Removes the selected row from the Field Name list.

See Also

Tasks

How to: Create Queries (Visual FoxPro)

Reference

Group By Tab, Query and View Designers

SELECT - SQL Command

CREATE QUERY Command

Other Resources

Dialog Boxes (Visual FoxPro)

Query and View Designers