Running Sum in 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] & "'")

anyone could help me please?

Thanks
 
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
 
J

John Spencer

Try the following:

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

Note that the PartData probably returns a number and Dia is a number.
So you would not delimit the value of dia with quote marks.

By the way, "it doesn't work" is not a very good description of the
problem. Better might be something like:
it returns Error for every value
or I get a syntax error that says ...
or the query runs forever
or my computer bursts into flames


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

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

Similar Threads


Top