calculating running total of a field in a query

S

SMT

I have a query that calculates the number of planned and then the completed
innovations by month. I would like to be able to have a running total of the
planned field and the same for the completed, in other words a cumulative
total of each as the year progresses. Below is the sql from the query.

SELECT tblMonth.month_name, qryPlannedOnly.PlannedlCumulativeCount,
qryActualOnly.ActualCumulativeCount, qryActualOnly.dir, tblMonth.month_id
FROM (tblMonth LEFT JOIN qryActualOnly ON tblMonth.month_name =
qryActualOnly.ActualCumulativeMonth) LEFT JOIN qryPlannedOnly ON
tblMonth.month_name = qryPlannedOnly.PlannedlCumulativeMonth
ORDER BY tblMonth.month_id;

So from this query I get

month_name PlannedlCumulativeCount ActualCumulativeCount dir month_id
Oct 12 12 E 1
Nov 17 15 E 2


and need a running total for plannedcumulativecount and a running total for
Actualcumulativecount

Oct 12 12 E 1
Nov 29 27 E 2
 
G

Gary Walter

I have a query that calculates the number of planned and then the completed
innovations by month. I would like to be able to have a running total of
the
planned field and the same for the completed, in other words a cumulative
total of each as the year progresses. Below is the sql from the query.

SELECT tblMonth.month_name, qryPlannedOnly.PlannedlCumulativeCount,
qryActualOnly.ActualCumulativeCount, qryActualOnly.dir, tblMonth.month_id
FROM (tblMonth LEFT JOIN qryActualOnly ON tblMonth.month_name =
qryActualOnly.ActualCumulativeMonth) LEFT JOIN qryPlannedOnly ON
tblMonth.month_name = qryPlannedOnly.PlannedlCumulativeMonth
ORDER BY tblMonth.month_id;

So from this query I get

month_name PlannedlCumulativeCount ActualCumulativeCount dir
month_id
Oct 12 12 E 1
Nov 17 15 E 2


and need a running total for plannedcumulativecount and a running total
for
Actualcumulativecount

Oct 12 12 E 1
Nov 29 27 E 2

Hi SMT,

If this is for a report, save yourself a whole lot
of trouble and just set the running sum property
of textboxes for these 2 fields.

good luck,

gary
 
S

SMT

This is not for a report, I am making a chart so I think I need the
calculations to be completed in the query. I wish it were for a report
because that is much easier :)
 

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