Comparisons between time and date data types

SQL Anywhere uses the following rules when comparing time and date data types. The rules are examined in the order listed, and the first rule that applies is used:

  1. If the data type of either argument is TIME, convert both to TIME and compare.

  2. If either data type has the type DATE or TIMESTAMP, convert to both to TIMESTAMP and compare.

    For example, if the two arguments are of type REAL and DATE, they are both converted to TIMESTAMP.

  3. If one argument has NUMERIC data type and the other has FLOAT, convert both to DOUBLE and compare.