
Originally Posted by
Kimbertha
...
Here is the SQL from my query:
SELECT Test.Date AS DateAlias, Sum(Test.Amount) AS SumOfAmount,
DSum("Amount","Test","[Date]<=" & [DateAlias] & "") AS RunningTotal
FROM Test
GROUP BY Test.Date
ORDER BY Test.Date;
Here is what the data table Test looks like:
Date Amount Desired Running Sum
01/10/2004 35 35
05/25/2005 10 40 (45?)
06/01/2007 5 45 (50?)
and so on
...
I've played around with the single and double quotes, pound # signs, brackets, etc. without success. There is some small thing that I'm just not getting.
Kim, I know you say you've tried the pound signs already, but pbaldy is right.
Your query should be:
Code:
SELECT Test.Date AS DateAlias, Sum(Test.Amount) AS SumOfAmount,
DSum("Amount","Test","[Date]<=#" & [DateAlias] & "#") AS RunningTotal
FROM Test
GROUP BY Test.Date
ORDER BY Test.Date;
See the attachment if you'd like to see it in action.