I get this error when trying to insert a date to my database from microsoft access
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Undefined function 'to_date' in expression.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6956)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7113)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3148)
.....
here is the prepared statement that i use
addUserSt = con.prepareStatement("insert into Accounts(Username, First_name, last_name, gender, birthday, email, civil_status, password) "
+ "values(?,?,?,?,to_date('17-January-97', 'DD-Month-RR'),?,?,?)");
here's how i execute the statement.. dc is an object. The variables like uname, fname, lname etc are all strings.
dc.addUserSt.setString(1, uname);
dc.addUserSt.setString(2, fname);
dc.addUserSt.setString(3, lname);
dc.addUserSt.setString(4, gender);
dc.addUserSt.setString(5, email);
dc.addUserSt.setString(6, civil);
dc.addUserSt.setString(7, pass);
dc.addUserSt.executeUpdate();
I don't know why it says that the to_date function is undefined. Could anyone help me with this? Thanks in advance.