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
Notes
  • 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'
    '1964/03/13'
    '1964-03-13'

    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.