Running Sum on a query

H

Hugo

Hi! i have a problem that i can´t solve. I´m trying to do a running Sum on a
query but it doesn´t work. Here it goes:

Table H_d : Datacorte --- Date
ContarDe#Falta---- Number

Waht i have is this:

02/06/2009 2
03/06/2009 3
04/06/2009 1

What i want:
02/06/2009 2
03/06/2009 5
04/06/2009 6

I use this, but it doesn´t work,and i don´t know why.

TotParc: DSum("[ContarDe#Falta]";"H_d";"PartData('m';[Datacorte])<='" &
[mes] & "' AND PartData('d';[Datacorte])<='" & [dia] & "'")
 
H

Hugo

I know that i can do this on a report, but i need the values to calculate an
average on another query.

Thanks
 
D

Duane Hookom

Try:

SELECT DataCorte, [ContarDe#Falta],
(SELECT Sum[ContarDe#Falta]) FROM H_D B WHERE B.DtaCorte <= H_D.DtaCorte)
FROM H_d;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top