Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - SQL Usage » Querying and Modifying Data » Querying data » The WHERE clause: Specifying rows


Comparing dates in search conditions

You can use operators other than equals to select a set of rows that satisfy the search condition. The inequality operators (< and >) can be used to compare numbers, dates, and even character strings.

♦  List all employees born before March 13, 1964
  • Automatic conversion to dates   The SQL Anywhere database server knows that the BirthDate column contains dates, and automatically converts the string 'March 13, 1964' to a date.

  • Ways of specifying dates   There are many ways of specifying dates. For example:
    'March 13, 1964'

    You can configure the interpretation of dates in queries by setting the date_order option database option. See date_order option [database].

    Dates in the format yyyy/mm/dd or yyyy-mm-dd are always recognized unambiguously as dates, regardless of the date_order setting.

  • Other comparison operators   SQL Anywhere supports several comparison operators. See Comparison operators.