hola..
por favor necesito ayuda con una consulta que tengo ke hacer a una tabla de access,
esto es lo ke tengo....................................................
Private Sub Command2_Click()
fecha1 = DateAdd("d", 15, Date$)
PSQL = "select * from productoscapi where fechavencimiento>= fecha1 "
Set RS = New ADODB.Recordset
RS.CursorType = adOpenStatic
RS.LockType = adLockOptimistic
RS.ActiveConnection = CN.ConnectionString
RS.CursorLocation = adUseServer
RS.Open PSQL
If RS.EOF = False Then
Set DataGrid1.DataSource = RS
End If
End Sub
..............................
se supone ke deberia traerme en un datagrid todos los registros con fecha de vencimiento menor a dentro de 15 dias.. en el acces el campo fechavencimiento esta como fecha corta..(dd/mm/aaaa)
he intentado con ..where datediff("d",fechavencimiento,date$)<=15 pero nada
gracias
por favor necesito ayuda con una consulta que tengo ke hacer a una tabla de access,
esto es lo ke tengo....................................................
Private Sub Command2_Click()
fecha1 = DateAdd("d", 15, Date$)
PSQL = "select * from productoscapi where fechavencimiento>= fecha1 "
Set RS = New ADODB.Recordset
RS.CursorType = adOpenStatic
RS.LockType = adLockOptimistic
RS.ActiveConnection = CN.ConnectionString
RS.CursorLocation = adUseServer
RS.Open PSQL
If RS.EOF = False Then
Set DataGrid1.DataSource = RS
End If
End Sub
..............................
se supone ke deberia traerme en un datagrid todos los registros con fecha de vencimiento menor a dentro de 15 dias.. en el acces el campo fechavencimiento esta como fecha corta..(dd/mm/aaaa)
he intentado con ..where datediff("d",fechavencimiento,date$)<=15 pero nada
gracias