| Author |
Syntax error converting datetime from character string.
|
S bitz
Ranch Hand
Joined: Jan 20, 2006
Posts: 80
|
|
Hi, I am trying to insert some values in a database.I'm using prepared statements and this is my query startDate and returnDate are of the format "YYYYMMDD" This throws this error : Syntax error converting datetime from character string. but when i change the query to pstmt.setString(4,"20060905") this works fine. I'm using SQL Server 2000. Can anyone tell me how this can be fixed? Thanks Bitz
|
 |
Shailesh Chandra
Ranch Hand
Joined: Aug 13, 2004
Posts: 1076
|
|
Convert Your String date to java.util.Date or Java.sql.DateSet them as date in preparedStaement, NOT as String Shailesh
|
Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
|
 |
 |
|
|
subject: Syntax error converting datetime from character string.
|
|
|