elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Estamos en la red social de Mastodon


  Mostrar Temas
Páginas: [1]
1  Programación / Java / Como obtener rango de fechas con JAVA en: 17 Junio 2013, 14:59 pm
Yo estoy usando JCaledar y tengo 2 JDateChosser tengo llenar 2 campos y luego enviar los variables las consultas hasta de aho no me sale alguien me solucionar aquí esta mi código:

 ///////////////////////////////////////////
    String formato1= lblCp.getText();
    java.util.Date date = Date.getDate();
    SimpleDateFormat sdf = new SimpleDateFormat(formato1);
    txtFechaSeleccionada.setText(sdf.format(date));
    txtFechaSeleccionada.getText();
    ////////////////////////////////////////////////7
    java.util.Date date2 = Date2.getDate();
    SimpleDateFormat sdf2 = new SimpleDateFormat(formato1);
    txtFechaSeleccionada2.setText(sdf2.format(date2));
    txtFechaSeleccionada2.getText();
    String sql="select Fecha_Ingreso as 'Fecha',Nombre as 'Nombre',Falta_Administrativa as 'Falta Cometida',"
            + "Sancion as 'Sanción',Recibo_Oficial as "
            + "'No. Recibo' from retenido where Fecha_Ingreso between "+txtFechaSeleccionada.getText()+"and"+txtFechaSeleccionada2.getText();
    pst=conn.prepareStatement(sql);
    rs=pst.executeQuery();
    tabla_reporte2.setModel(DbUtils.resultSetToTableModel(rs));
    jScrollPane3.getViewport().add(tabla_reporte2);

Espero una respuesta gracias
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines