Recordset con filtro de fechas
Publicado por Cecilia (12 intervenciones) el 07/07/2004 03:31:40
Sigo con problemas para filtrar por fechas en el siguiente recordset, me da que el proveedor no admite las propiedades.
Ya hice todos los cambios que me dijeron pero no funcionó ninguno.
Aca va otra vez el cod.:
Dim vFechaD As Variant
Dim vFechaH As Variant
vFechaD = \"#\" & Format(FechaD, \"mm/dd/yyyy\") & \"#\"
vFechaH = \"#\" & Format(FechaH, \"mm/dd/yyyy\") & \"#\"
Set CX = New ADODB.Connection
propert = \"DSN=Visual FoxPro Tables;UID=;SourceDB=\" & gPathDB & \";SourceType=DBF;Exclusive=No;BackgroundFetch=Sí;Collate=Machine;\"
CX.ConnectionString = \"Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=\" & propert
\'Abrir el objeto Connection
CX.Open
\'Crear el Recordset
Set RS1 = New ADODB.Recordset
sT = \"\"
sT = \" SELECT GVA14.CUIT CUIT,GVA12.Fecha_emis Fecha_emis,\"
sT = sT & \" GVA42.T_comp T_comp,GVA42.N_comp N_comp, \"
sT = sT & \" GVA12.Importe Importe, GVA42.Importe Imp_ret\"
sT = sT & \" FROM ((GVA12 INNER JOIN GVA42 \"
sT = sT & \" ON GVA12.T_comp = GVA42.T_comp AND \"
sT = sT & \" GVA12.N_comp = GVA42.N_comp)\"
sT = sT & \" LEFT JOIN GVA14 \"
sT = sT & \" ON GVA12.Cod_client = GVA14.Cod_client)\"
sT = sT & \" WHERE GVA12.Fecha_emis between vFechaD\"
sT = sT & \" and vFechaH \"
Muchas gracias!!
Salu2,
Cecilia.
Ya hice todos los cambios que me dijeron pero no funcionó ninguno.
Aca va otra vez el cod.:
Dim vFechaD As Variant
Dim vFechaH As Variant
vFechaD = \"#\" & Format(FechaD, \"mm/dd/yyyy\") & \"#\"
vFechaH = \"#\" & Format(FechaH, \"mm/dd/yyyy\") & \"#\"
Set CX = New ADODB.Connection
propert = \"DSN=Visual FoxPro Tables;UID=;SourceDB=\" & gPathDB & \";SourceType=DBF;Exclusive=No;BackgroundFetch=Sí;Collate=Machine;\"
CX.ConnectionString = \"Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=\" & propert
\'Abrir el objeto Connection
CX.Open
\'Crear el Recordset
Set RS1 = New ADODB.Recordset
sT = \"\"
sT = \" SELECT GVA14.CUIT CUIT,GVA12.Fecha_emis Fecha_emis,\"
sT = sT & \" GVA42.T_comp T_comp,GVA42.N_comp N_comp, \"
sT = sT & \" GVA12.Importe Importe, GVA42.Importe Imp_ret\"
sT = sT & \" FROM ((GVA12 INNER JOIN GVA42 \"
sT = sT & \" ON GVA12.T_comp = GVA42.T_comp AND \"
sT = sT & \" GVA12.N_comp = GVA42.N_comp)\"
sT = sT & \" LEFT JOIN GVA14 \"
sT = sT & \" ON GVA12.Cod_client = GVA14.Cod_client)\"
sT = sT & \" WHERE GVA12.Fecha_emis between vFechaD\"
sT = sT & \" and vFechaH \"
Muchas gracias!!
Salu2,
Cecilia.
Valora esta pregunta


0