The code I tried out:
Date d ;
Date d1;
DateFormat formatter,formatter1 ;
String s=cbDate.getSelectedItem()+"-"cb.getSelectedItem()"-"+cbYear.getSelectedItem();
String e=cbDate1.getSelectedItem()+"-"cb1.getSelectedItem()"-"+cbYear1.getSelectedItem();
try
{
formatter= new SimpleDateFormat("dd-MMM-yy");
d = formatter.parse(s);
System.out.println("d "+d);
d1 = formatter.parse(e);
System.out.println("d1 "+d1);
String sql="Select nofrom tble where aDate>= ? and aDate<=?";
pstmt=cn.prepareStatement(sql);
pstmt.setDate(1,new java.sql.Date(d.getTime()));
pstmt.setDate(2,new java.sql.Date(d1.getTime()));
rs=pstmt.executeQuery();
while(rsOrders.next()){
System.out.println(rsOrders.getString("no"))}
}
catch(Exception ex){}
No results