J
John Spencer
Well, if you are trying to use that subquery to return a value for a field you
must A) return only one field, B) return either no record or one record, C)
surround the entire subquery with parentheses, and D) use criteria to limit
what you are returning.
OR you can use that query as the entire query. I would try that first.
SELECT a.TransDate, a.CustID, LAST(a.ChargeAmount)
, SUM(b.ChargeAmount) as RunningSum
FROM Accounts As a INNER JOIN Accounts AS b
ON a.CustID=b.CustID AND a.TransDate>= b.TransDate
GROUP BY a.TransDate, a.CustID
ORDER BY a.CustID, a.TransDate
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
must A) return only one field, B) return either no record or one record, C)
surround the entire subquery with parentheses, and D) use criteria to limit
what you are returning.
OR you can use that query as the entire query. I would try that first.
SELECT a.TransDate, a.CustID, LAST(a.ChargeAmount)
, SUM(b.ChargeAmount) as RunningSum
FROM Accounts As a INNER JOIN Accounts AS b
ON a.CustID=b.CustID AND a.TransDate>= b.TransDate
GROUP BY a.TransDate, a.CustID
ORDER BY a.CustID, a.TransDate
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County