Forum Discussion
Tony2021
Aug 30, 2024Steel Contributor
Day Count Query
Hello Experts, I am having issues making a day count query for 3 criteria. I have a 1 table with tblDraws.[FundingDate] and I need to make a day count between the [FundingDate] but the criter...
- Sep 01, 2024
Is this what you mean?
SELECT D1.*,
NZ((SELECT MIN(FundingDate)
FROM tblDraws AS D2
WHERE D2.ProjID = D1.ProjID
AND D2.Type = D1.Type
AND D2.FundingDate > D1.FundingDate)-FundingDate,0) AS DayCount
FROM tblDraws AS D1
ORDER BY ProjID, Type, FundingDate;
Ken_Sheridan
Brass Contributor
Is this what you mean?
SELECT D1.*,
NZ((SELECT MIN(FundingDate)
FROM tblDraws AS D2
WHERE D2.ProjID = D1.ProjID
AND D2.Type = D1.Type
AND D2.FundingDate > D1.FundingDate)-FundingDate,0) AS DayCount
FROM tblDraws AS D1
ORDER BY ProjID, Type, FundingDate;
Tony2021
Sep 01, 2024Steel Contributor
perfect! I see what you did. I understand it (a little). thank you sir!