Experts, I have a query that shows a day count between 2 dates ([ValueDate]) with condition Where T.FacilityType=Q_Disbursem
How can I modify the below to prompt user to enter a date which the last record date range extends to?
Example, in the below pic, you can see that for the next to last record in JBIC, the date is February 29, 2016 and the day count is 70 (Feb 29 to May 9) but what I need is a msgbox that pops up and asks the user to enter a date. If that date, for example, was May 10, 2016 and not May 9 as shown in the pic, the day count would be 71 (Feb 29 to May 10). User would enter in a date much later than that though. My example is for simplicity.
I hope that makes sense. It likely doesnt so please ask me if need.
attached a db with Q_DisbursementSum.
here is the sql though:
SELECT Q_Disbursement.FacilityType, Q_Disbursement.ValueDate, Q_Disbursement.FacilityAmount, Q_Disbursement.Amount, (Select Sum(T.Amount) From Q_Disbursement As T Where T.FacilityType=Q_Disbursement.FacilityType And T.ValueDate <= Q_Disbursement.ValueDate) AS [Cumulative Drawn], [FacilityAmount]-[Cumulative Drawn] AS Available, DateDiff("d",[ValueDate],(Select Min(Q.ValueDate) From Q_Disbursement As Q Where Q.FacilityType = Q_Disbursement.FacilityType And Q.ValueDate > Q_Disbursement.ValueDate)) AS DayCountx
GROUP BY Q_Disbursement.FacilityType, Q_Disbursement.ValueDate, Q_Disbursement.FacilityAmount, Q_Disbursement.Amount, Q_Disbursement.FacilityAmount
ORDER BY Q_Disbursement.FacilityType, Q_Disbursement.ValueDate;
screeshot of query: