BUSCAR ENTRE DOS CANTIDADES CON ADO
PERDONAR POR REPETIR LA CABEZERA, PERO AQUI OS PONGO EL FALLO QUE ME DA, Y NO SE POR QUE....SOLO ME FALTA REPARAR ESTE SISTEMA DE BUSQUEDA Y YA ESTA, POR FAVOR AYUDARME....COMO LO HAGO.
Private Sub Comm_Click()
sentencia = "select * from VENTAS where POBLACIONPRODUTO='" & Text2.Text & "'"
sentencia = sentencia & " and TIPOPRODUCTO='" & Text3.Text & "'"
sentencia = sentencia & " and importerequerido>='" & Text7.Text & "'"
sentencia = sentencia & " and importerequerido<='" & Text8.Text & "'"
Adodc1.RecordSource = sentencia
Adodc1.Refresh
' FALLO QUE ME DA: no coinciden los datos en la expresion de criterios.
End Sub
Private Sub Comm_Click()
sentencia = "select * from VENTAS where POBLACIONPRODUTO='" & Text2.Text & "'"
sentencia = sentencia & " and TIPOPRODUCTO='" & Text3.Text & "'"
sentencia = sentencia & " and importerequerido>='" & Text7.Text & "'"
sentencia = sentencia & " and importerequerido<='" & Text8.Text & "'"
Adodc1.RecordSource = sentencia
Adodc1.Refresh
' FALLO QUE ME DA: no coinciden los datos en la expresion de criterios.
End Sub
supongo que da fallo pq quieres comparar datos de tipo texto por datos de tipo double o int
aber si esto te puede ayudar
pon lo siguiente:
Private Sub Comm_Click()
sentencia = "select * from VENTAS where POBLACIONPRODUTO=\'" & Text2.Text & "\'"
sentencia = sentencia & " and TIPOPRODUCTO=\'" & Text3.Text & "\'"
sentencia = sentencia & " and importerequerido>=\'" & cdbl(Text7.Text) & "\'"
sentencia = sentencia & " and importerequerido<=\'" & cdbl(Text8.Text) & "\'"
Adodc1.RecordSource = sentencia
Adodc1.Refresh
End Sub
aber si esto te puede ayudar
pon lo siguiente:
Private Sub Comm_Click()
sentencia = "select * from VENTAS where POBLACIONPRODUTO=\'" & Text2.Text & "\'"
sentencia = sentencia & " and TIPOPRODUCTO=\'" & Text3.Text & "\'"
sentencia = sentencia & " and importerequerido>=\'" & cdbl(Text7.Text) & "\'"
sentencia = sentencia & " and importerequerido<=\'" & cdbl(Text8.Text) & "\'"
Adodc1.RecordSource = sentencia
Adodc1.Refresh
End Sub
