Duda en Sentencia SQL en Visual Basic 6

Iniciado por GhostLT, 21 Agosto 2009, 00:07 AM

0 Miembros y 1 Visitante están viendo este tema.

GhostLT

Lo que deseo es que cuando seleccione en el DTPiker inicial y el DTPfinal un rango de fechas me filtre las facturas creadas en esas fechas y me lo muestre en un List1

'------------------Module Sentence---------------------------------------------------
Sub main()
With Base   
    .CursorLocation = adUseClient
    .Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sistemaelangel.mdb;Persist Security Info=False"
    LoginForm.Show
End With
End Sub
'------------------Module Declare-----------------------------------------------------
Global Base As New ADODB.Connection

Global RsFactura As New ADODB.Recordset



------------------Código en el Form--------------------------------------------------
Sub llenalista1()
Dim sqllista1 As String
sqllista1 = "SELECT COUNT(fecha) as cantidad FROM TablaFactura AND  fecha BETWEEN #" & Format(DTPicker1, "mm/dd/yyyy") & "# AND #" & Format(DTPicker2, "mm/dd/yyyy") & "#"

List1.Clear
Do While Not TablaFactura.EOF
List1.AddItem TablaFactura.Fields("cantidad")
TablaFactura.MoveNext
Loop

End sub                                               :huh:
There is some fiction in you truth, and some truth in you fiction