1 Reply Latest reply on Oct 12, 2008 11:45 AM by 791266

    How to use date ion where condition?

    807589
      Hi,
      I need to use "11-10-08" in where condition.
      but I am getting error message
      " javax.servlet.ServletException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression."
      Here cdate is date field in date11 table.
      How to correct this error?

      <%@ page import= "java.sql.*"%>
      <%@ page import="java.util.Date"%>
      <%

           Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb1");
           PreparedStatement st = con.prepareStatement("Select * from date11 where cdate='11-10-08'");
      ResultSet rs=st.executeQuery();
      while(rs.next())
      {
      out.print(rs.getString(1));
      }
      st.close();
      con.close();
      %>