Weekly Running Totals

R

Ryan Nelson

Hello,

I've got a simple database used to schedule deliveries which contains one
main table of orders. The 2 main fields are the scheduled delivery date
(scheduled) and order value (value). I need to present the user with a
running total for both number of orders and order value that has a schedule
delivery date in the current working week (Mon-Fri). If I could also
generate similar totals for the month so far that would also be useful. Any
ideas how I might achieve this?
 
M

Michel Walsh

Hi,


A running total starting at 0 each Lundy?


SELECT a.scheduled, a.order, LAST(a.value) As thisOrderValue, SUM(b.value)
As runningValueForTheWeek
FROM table AS a INNER JOIN table AS b
ON a.scheduled >= b.scheduled AND 0=DateDiff("ww", a.scheduled,
b.scheduled)
GROUP BY a.scheduled, a.order




Hoping it may help,
Vanderghast, Access MVP
 
R

Ryan Nelson

Thanks Michel, I will try that code.

Michel Walsh said:
Hi,


A running total starting at 0 each Lundy?


SELECT a.scheduled, a.order, LAST(a.value) As thisOrderValue, SUM(b.value)
As runningValueForTheWeek
FROM table AS a INNER JOIN table AS b
ON a.scheduled >= b.scheduled AND 0=DateDiff("ww", a.scheduled,
b.scheduled)
GROUP BY a.scheduled, a.order




Hoping it may help,
Vanderghast, Access MVP
 

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