sql - cast a varchar to date -


I use an H2 database for a small project, varchar all fields

a query For, I should convert a string up to date so that I tried where to put the user (SELECT DATE_CONTRACT as date) & gt; '2005-02-21' is an error

Code:

Error Code 90009, SQL State 90009: Date Can not parse continuously "2011-02-21-15.2.07", the reason: "java.lang.NumberFormatException: for input string:" "21-15.22.07"; ";

Any ideas?

Thank you

You must use the Percetate Time () in order your character To "insert" data on a date

Something like this:

 SELECT * from the user where the person's time (DATE_CONTRACT, 'yyyy-MM-Dd-HH.mm.ss')> ; The date '2005-02-21'  

Another good reason to store dates, timestamps, or numbers anytime as a character data

Comments