Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Date literals with IN clause

Steve
2012-05-31
2014-01-19
  • Steve
    Steve
    2012-05-31

    Not sure if this is a bug, or just how date types work in HSQLDB 2.x. When comparing a date field with a date literal, the following will work:

    select * from datelookup where date = '2012-01-01'

    However when the literal value is in an IN clause, the "DATE" prefix is required. The following works:

    select * from datelookup where date IN ( DATE '2012-01-01', DATE '2012-01-02' )

    but the following fails:

    select * from datelookup where date IN ( '2012-01-01', '2012-01-02' )

    The error message returned is "incompatible data types in combination"

    The same issue occurs for timestamp and time fields.

    - steve