Ver Mensaje Individual
  #8 (permalink)  
Antiguo 06/06/2008, 11:37
guille_el3
 
Fecha de Ingreso: abril-2008
Mensajes: 264
Antigüedad: 16 años
Puntos: 2
Respuesta: cual fecha es mayor?

Cita:
Iniciado por maikel76 Ver Mensaje
Buenas, necesito una ayuda. Tengo un reporte que entregar (DataReport) y ya hice una sentencia en Sql y esoty filtrando la fecha muy bien y ahora necesito filtrar la fecha mas otro campo, osea, queiro que me refleje si el Contribuyente CANTV(ejemplo) ha pagado en el mes de mayo del 2008. entonces ya yengo filtrada la fecha y se lo muestro como filtro tambien el campo + la fecha.

Private Sub cmbconsulta_click()
Dim MiSQL As String
On Error GoTo Cancel
Cancel:
If Err.Number = 13 Then
Close
Exit Sub
End If
Dim respt
x = Date
If DtpDesde > x Then
MsgBox "La Fecha Inicial no Puede Ser Mayor a la Fecha Actual", vbExclamation, "Consultas"
Exit Sub
End If
If DtpHasta > x Then
MsgBox "La Fecha Final no Puede Ser Mayor a la Fecha Actual", vbExclamation, "Consultas"
Exit Sub
End If
MiSQL = "SELECT * FROM Certificación WHERE Emision_factura Between #" & Format(DtpDesde, "m/d/yyyy") & "# And #" & Format(DtpHasta + 1, "m/d/yyyy") & "# order by Nombre" Debug.Print MiSQL
If adoImpDia.State = adStateOpen Then adoImpDia.Close
Enlace adoImpDia, MiSQL
Set RptGeneral.DataSource = adoImpDia
RptGeneral.Title = "Reporte General del Sistema" & " Desde " & DtpDesde & " Hasta " & DtpHasta
RptGeneral.Caption = "Reporte General del Sistema"
RptGeneral.Show
End Sub
este es mi filtro actual pero quiero agregarle a la sentencia Sql la fecha mas el campo.
No se si esta bueno que uses threads de otro para hacer tus consultas, y menos cuando no tienen mucho que ver... Igual te respondo, cualquier cosa que lo muevan:

SELECT campos
FROM tabla1,tabla2,...,tablan
WHERE (condicion1) AND (condicion2) AND (condicion3) OR(condicion4)
ORDER BY campo

espero que te sirva :)
__________________
Saludoss
Guille