Cumulative Totals in a query

S

SMT

Below is my query SQL. I need to see cumulative totals for [MonthlyDelivery]
and [Delivered On Time] Can anyone help.

SELECT tblMonthlyInput.ID, tblMonthlyInput.MonthlyDelivery,
tblMonthlyInput.[Delivered on Time], tblMonthlyInput.[Days over due],
tblMonthlyInput.BranchDiv, tblDeliveryType.[Delivery Type],
tblMonthlyInput.OverDue, tblMonth.Month, ([Delivered On
Time]/[MonthlyDelivery]) AS [Monthly Complete and Ontime],
tblMonthlyInput.MonthID
FROM tblDeliveryType INNER JOIN (tblMonth INNER JOIN tblMonthlyInput ON
tblMonth.MonthID = tblMonthlyInput.MonthID) ON tblDeliveryType.DeliveryID =
tblMonthlyInput.DeliveryType
WHERE
(((tblMonthlyInput.BranchDiv)=[Forms]![FilterRecordsMenu]![SelectDivision]));
 
L

Larry Linson

Where do you need to see them? Is the Query used as Record Source for a
Form or a Report? Surely you are not working in datasheet view of the
Query, are you?

Your best option would be to look at the data in a Report and use the
Running Sum option on the Controls in which you display the values.

Larry Linson
Microsoft Office Access MVP

SMT said:
Below is my query SQL. I need to see cumulative totals for
[MonthlyDelivery]
and [Delivered On Time] Can anyone help.

SELECT tblMonthlyInput.ID, tblMonthlyInput.MonthlyDelivery,
tblMonthlyInput.[Delivered on Time], tblMonthlyInput.[Days over due],
tblMonthlyInput.BranchDiv, tblDeliveryType.[Delivery Type],
tblMonthlyInput.OverDue, tblMonth.Month, ([Delivered On
Time]/[MonthlyDelivery]) AS [Monthly Complete and Ontime],
tblMonthlyInput.MonthID
FROM tblDeliveryType INNER JOIN (tblMonth INNER JOIN tblMonthlyInput ON
tblMonth.MonthID = tblMonthlyInput.MonthID) ON tblDeliveryType.DeliveryID
=
tblMonthlyInput.DeliveryType
WHERE
(((tblMonthlyInput.BranchDiv)=[Forms]![FilterRecordsMenu]![SelectDivision]));

__________ Information from ESET Smart Security, version of virus
signature database 4002 (20090411) __________

The message was checked by ESET Smart Security.

http://www.eset.com



__________ Information from ESET Smart Security, version of virus signature database 4002 (20090411) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
S

SMT

I actually have the cumulative totals working in the report using the running
sum option but was my boss wants some of the data exported to excel (so he
can do further graphing) so I was going to going to set the running sum
totals in the query before the export, but maybe its better to do it in excel
(using an excel template)?

Larry Linson said:
Where do you need to see them? Is the Query used as Record Source for a
Form or a Report? Surely you are not working in datasheet view of the
Query, are you?

Your best option would be to look at the data in a Report and use the
Running Sum option on the Controls in which you display the values.

Larry Linson
Microsoft Office Access MVP

SMT said:
Below is my query SQL. I need to see cumulative totals for
[MonthlyDelivery]
and [Delivered On Time] Can anyone help.

SELECT tblMonthlyInput.ID, tblMonthlyInput.MonthlyDelivery,
tblMonthlyInput.[Delivered on Time], tblMonthlyInput.[Days over due],
tblMonthlyInput.BranchDiv, tblDeliveryType.[Delivery Type],
tblMonthlyInput.OverDue, tblMonth.Month, ([Delivered On
Time]/[MonthlyDelivery]) AS [Monthly Complete and Ontime],
tblMonthlyInput.MonthID
FROM tblDeliveryType INNER JOIN (tblMonth INNER JOIN tblMonthlyInput ON
tblMonth.MonthID = tblMonthlyInput.MonthID) ON tblDeliveryType.DeliveryID
=
tblMonthlyInput.DeliveryType
WHERE
(((tblMonthlyInput.BranchDiv)=[Forms]![FilterRecordsMenu]![SelectDivision]));

__________ Information from ESET Smart Security, version of virus
signature database 4002 (20090411) __________

The message was checked by ESET Smart Security.

http://www.eset.com



__________ Information from ESET Smart Security, version of virus signature database 4002 (20090411) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 

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