I consult 3 tables with range of dates, my small application is in development, in the main table or the first I have 4 records in the second I have 5 and in the third 7 records, but it turns out that it only extracts me from the tables 4 records of each table, when in the instruction in the range of the date I put the most recent final date to the record that is in my table this is my query
Dim InfoIni As String = Format(DTPIni.Value, "MM/dd/yyyy")
Dim InfoFin As String = Format(DTPFin.Value, "MM/dd/yyyy")
Dim Totales As String = _
"SELECT SUM (CUOTAS.CUOTA)AS CUOTA, SUM(CUOTAS.INASISTENCIA)AS INASISTENCIA, SUM(CUOTAS.MULTAS)AS MULTAS, SUM (CUOTAS.OTROS)AS NuevoSocio, " _
& "SUM (PRESTAMOS.ABONO)AS ABONO, SUM (PRESTAMOS.CONDONO)AS CONDONO, SUM(PRESTAMOS.NUEVO)AS NuevoPrestamo, " _
& "SUM(GASTOS.IMPORTE)AS ImporteGasto " _
& "FROM (CUOTAS INNER JOIN PRESTAMOS ON PRESTAMOS.Id = CUOTAS.Id) " _
& "INNER JOIN GASTOS ON GASTOS.Id = CUOTAS.Id WHERE CUOTAS.FECHA BETWEEN #" & InfoIni & "# AND #" & InfoFin & "#"
Each table has a Id
field, one of Fecha
How do I rescue all the records that are in the range?
My tables are in Access and VB.NET.