Hi, I'm doing a project where I have records with date field and I need to filter by date in JTable to do the iReport report afterwards and I can not do that filter. Use as a database ACCESS , how can I do that filter query?
' private void BUSCARActionPerformed(java.awt.event.ActionEvent evt) {
String consulta ="";
try{
if(fechabus.isSelected()==true){
//Date fec= new Date();
Date fec1 = desde.getDate();
Date fec2 = hasta.getDate();
//Date fecha1=new java.sql.Date(fec.getTime());
//Date fecha2=new java.sql.Date(fec.getTime());
//Tabla("SELECT * FROM Facturas_Ventas WHERE Fecha_Comp BETWEEN '"+desde.getDate()+"' AND '"+hasta.getDate()+"'");
Date fec= new Date();
fec= desde.getDate();
Date fecha=new java.sql.Date(fec.getTime());
Tabla(fecha);
cant.setText(""+datos.getRowCount());
}'
'if(cliente.isSelected()==true){
Tabla(clientes.getText());
clientetext.setText("");
clientes.setText("");
cant.setText(""+datos.getRowCount());
}
if(todo.isSelected()==true){
Tabla("");
cant.setText("");
}
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
} '