=Sum([BeginBalance]+[1Receipt]-[1Disbursement]+[2Receipt]-[2Disbursement]+[3Receipt]-[3Disbursement]+[4Receipt]-[4Disbursement]+[5Receipt]-[5Disbursement]+[6Receipt]-[6Disbursement]+[7Receipt]-[7Disbursement]+[8Receipt]-[8Disbursement]+[9Receipt]-[9Disbursement]+[10Receipt]-[10Disbursement]+[11Receipt]-[11Disbursement])
SELECT
T1.[CustomerID],
T1.TransactionType,
YEAR(T1.TransactionDate) AS TranactionYear,
MONTH(T1.TransactionDate) AS TranactionMonth,
SUM(T1.Credit) AS Credits,
SUM(T1.Debit) AS Debits,
(
SELECT
SUM(Credit - Debit)
FROM
TransactionsCD AS T2
WHERE
T2.CustomerID = T1.CustomerID
AND T2.TransactionType = T1.TransactionType
AND FORMAT(T2.TransactionDate, "yyyymm") <= FORMAT(T1.TransactionDate, "yyyymm")
) AS Balance
FROM
TransactionsCD AS T1
GROUP BY
T1.[CustomerID],
T1.TransactionType,
YEAR(T1.TransactionDate),
MONTH(T1.TransactionDate),
FORMAT(T1.TransactionDate, "yyyymm");
Copilot tells me...
Yeah, I know but it sure saved me the other day trying to figure out some code for Excel to manipulate Word. I was quite surprised.Ugh.
It certainly can give you a head start.Yeah, I know but it sure saved me the other day trying to figure out some code for Excel to manipulate Word. I was quite surprised.
AI is neither inherently good nor inherently bad. It's a tool. Used wisely, it is beneficial. Used inappropriately, it can lead to problems.Ugh.
After some tests I find out that the controlsource property max lenght is : 2048, and the maximum number of fields in a sum is 100.