Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Posts
    21

    Question Unanswered: Wrong date string in Where clause???

    Hi all!!!

    Well, I'm trying to select some records from my DB2 database using jdbc, but I have this error:

    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/LINUX] SQL0180N The syntax of the string representation of a datetime value is incorrect.


    How do I have to implement the where clause???
    I have done it like this: "...... where chkindate > '2003-02-01' ..... "
    Why it is wrong???

    Thank you very much in advance????

    Cheers!

  2. #2
    Join Date
    Feb 2003
    Location
    Other side of the ocean
    Posts
    6
    try to use Date, Time, and Timestamp Escape Sequences:
    The escape sequence for date, time, and timestamp literals is:

    {literal-type 'value'}

    where literal-type is one of the following:
    literal-type
    Description
    Value Format

    d
    Date
    yyyy-mm-dd

    t
    Time
    hh:mm:ss [1]

    ts
    Timestamp
    yyyy-mm-dd hh:mm:ss[.f...]

    so in your case;
    ... where chkindate > {d'2003-02-01'} ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •