I have the following query which will run on any given date. How could I obtain the previous value for ActualBal?
i.e., if the report date is run for 5/1/21, would could I get the ActualBal for 4/30/21?
i.e., if the report date is run for 5/1/21, would could I get the ActualBal for 4/30/21?
SELECT qryRMonthlySumTrans2.TransactionID, qryRMonthlySumTrans2.TransactionDate, qryRMonthlySumTrans2.AirlineCompanyLookup, qryRMonthlySumTrans2.BegBalance, qryRMonthlySumTrans2.GallonsRcvd, qryRMonthlySumTrans2.GallonsIssd, qryRMonthlySumTrans2.Total, qryRMonthlySumTrans4GainLoss.AirGainLossNz, Nz(([Total]+[AirGainLossNZ]),0) AS ActualBal
FROM qryRMonthlySumTrans2 LEFT JOIN qryRMonthlySumTrans4GainLoss ON qryRMonthlySumTrans2.AirlineCompanyLookup = qryRMonthlySumTrans4GainLoss.AirlineCompanyLookup
WHERE (((qryRMonthlySumTrans2.TransactionDate) Between [TempVars]![tmpStartDate] And [TempVars]![tmpEndDate]))
GROUP BY qryRMonthlySumTrans2.TransactionID, qryRMonthlySumTrans2.TransactionDate, qryRMonthlySumTrans2.AirlineCompanyLookup, qryRMonthlySumTrans2.BegBalance, qryRMonthlySumTrans2.GallonsRcvd, qryRMonthlySumTrans2.GallonsIssd, qryRMonthlySumTrans2.Total, qryRMonthlySumTrans4GainLoss.AirGainLossNz;