Runningsum

A

Andy

Friends,
thanks a lot for replying me.
But still in problem!!!!!!
I tried the query with all of you had Suggested but didn't work. So I think
I am making mistake somewhere !!!!
Here is I would like to have in calculated field in query-table
Date Lot# SubLot# HMAPlaced CumulativeHMAPlaced
(1) (2) (3) (4) (5)
Field (5) is calculated Field. Data are as follow,

Apr 1 1 1 500 500 Field
(5) is RunningSUM
Apr 1 1 2 500 1000
Apr 1 1 3 500 1500
Apr 1 1 4 100 1600
Apr 2 1 4 400 2000
Apr 2 2 1 500 2500
Apr 2 2 2 400 2900
When I Tried, I got all 500 Or 2900 !!!!!!! Can anyone Actualy try by
creating Query and check if You get Result like in Field (5)
 
J

John W. Vinson

Friends,
thanks a lot for replying me.
But still in problem!!!!!!
I tried the query with all of you had Suggested but didn't work. So I think
I am making mistake somewhere !!!!
Here is I would like to have in calculated field in query-table
Date Lot# SubLot# HMAPlaced CumulativeHMAPlaced
(1) (2) (3) (4) (5)
Field (5) is calculated Field. Data are as follow,

Apr 1 1 1 500 500 Field
(5) is RunningSUM
Apr 1 1 2 500 1000
Apr 1 1 3 500 1500
Apr 1 1 4 100 1600
Apr 2 1 4 400 2000
Apr 2 2 1 500 2500
Apr 2 2 2 400 2900
When I Tried, I got all 500 Or 2900 !!!!!!! Can anyone Actualy try by
creating Query and check if You get Result like in Field (5)

SELECT [Date], [Lot#], [Sublot#], [HMAPlaced], (Sum([HMAPlaced]) FROM
yourtable AS X WHERE X.[Date] <= yourtable.[Date] AND X.[Lot#] <=
yourtable.[Lot#] AND X.[Sublot#] <= yourtable.[Sublot#]) AS
CumulativeHMAPlaced
FROM yourtable
ORDER BY [Date], [Lot#], [Sublot#];

Change yourtable to the actual name of your table.

It would have been helpful if you had opened the failing query in SQL view and
posted the SQL, and indicated what answer it was actually giving you.

John W. Vinson [MVP]
 
A

Andy

Thanks John,

I copy and past this Query and tried to run, it said Synstex Error
but then I creat Query as per this query using Query Table and run it. But
it doesn't do cumulative sum but wrote only 500 in all records row in that
field.
So something somewhere worng that I can't figured out!!!!!!
Andy

John W. Vinson said:
Friends,
thanks a lot for replying me.
But still in problem!!!!!!
I tried the query with all of you had Suggested but didn't work. So I think
I am making mistake somewhere !!!!
Here is I would like to have in calculated field in query-table
Date Lot# SubLot# HMAPlaced CumulativeHMAPlaced
(1) (2) (3) (4) (5)
Field (5) is calculated Field. Data are as follow,

Apr 1 1 1 500 500 Field
(5) is RunningSUM
Apr 1 1 2 500 1000
Apr 1 1 3 500 1500
Apr 1 1 4 100 1600
Apr 2 1 4 400 2000
Apr 2 2 1 500 2500
Apr 2 2 2 400 2900
When I Tried, I got all 500 Or 2900 !!!!!!! Can anyone Actualy try by
creating Query and check if You get Result like in Field (5)

SELECT [Date], [Lot#], [Sublot#], [HMAPlaced], (Sum([HMAPlaced]) FROM
yourtable AS X WHERE X.[Date] <= yourtable.[Date] AND X.[Lot#] <=
yourtable.[Lot#] AND X.[Sublot#] <= yourtable.[Sublot#]) AS
CumulativeHMAPlaced
FROM yourtable
ORDER BY [Date], [Lot#], [Sublot#];

Change yourtable to the actual name of your table.

It would have been helpful if you had opened the failing query in SQL view and
posted the SQL, and indicated what answer it was actually giving you.

John W. Vinson [MVP]
 
J

John W. Vinson

Thanks John,

I copy and past this Query and tried to run, it said Synstex Error
but then I creat Query as per this query using Query Table and run it. But
it doesn't do cumulative sum but wrote only 500 in all records row in that
field.
So something somewhere worng that I can't figured out!!!!!!

Please open your Query in SQL view and post the SQL text here.

John W. Vinson [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