Estimados amigos del foro, como menciono el el título, tengo una consulta, dos DTPicker y un boton, donde quiero traer datos según las fechas que selecciono, el Mysql las tengo así yyyy-mm-dd, tipo Date, y en visual me las muestra así dd/mm/yyyy.
Mi código es el sgte.
###############################################
Private Sub Command1_Click()
Dim fechainicio As String
Dim fechafin As String
fechainicio = Format(DTPicker1(0).Value, "yyyy-MM-dd")
fechafin = Format(DTPicker2(1).Value, "yyyy-MM-dd")
Set rs = New ADODB.Recordset
rs.Open "Select * From miTabla WHERE fecha BETWEEN 'fechainicio' AND 'fechafin'", con, adOpenStatic, adLockOptimistic
Set grid1.DataSource = rs
Cmdreporte.Enabled = True
End Sub
Espero me puedan ayudar
Saludos cordiales, que tengan buen día!