Hi. I want a query to give me the details of invoice and payments between a start and end date. Also I want a beginning balance prior to the start date. This what I've done so far. I'm no Access expert.
SELECT FacturasAlCobroT.ConsiderarParaReporte, FacturasAlCobroT.NumFactura, FacturasAlCobroT.Nombre, FacturasAlCobroT.Cuenta, FacturasAlCobroT.Fondo, FacturasAlCobroT.Organizacion, FacturasAlCobroT.Programa, FacturasAlCobroT.Asignacion, FacturasAlCobroT.AnoPresupuestario, FacturasAlCobroT.AportacionFederal, [BalanceInicial] AS Expr1, FacturasAlCobroT.CantidadFactura, PagosT.CantidadPago, [BalanceFinal] AS Expr2, [FechaDesde] AS Expr3, [FechaHasta] AS Expr4
FROM FacturasAlCobroT INNER JOIN PagosT ON FacturasAlCobroT.NumFactura = PagosT.NumFactura
BalanceInicial will be the beginning balance, which will be (sum [CantidadFactura] - sum [CantidadPago]), all the transactions that are prior to the start date. [FechaDesde] is the start date and [FechaHasta] is the end date, those will be input in a Form.
[BalanceFinal] will be the beginning balance [BalanceInicial] + [CantidadFactura] - Sum[CantidadPago], for the Sum of CantidadPago, will be all the transactions that took place between the start date and end date.
Help please.
Thanks.