Microsoft Access - Sum of previous records - Asked By Rahim Huseyn on 02-Nov-12 05:16 AM

Hello Friends!

Access 2003...

I create a subreport in a report.

Contains records from a query.

In this subreport its like below:
Name  Qty
John    3
Tom    6
Yoxan    2    
Bob     7

I want to add one column to this subreport(it doesnt matter report or subreport:)), so that to contain sum of previous records from Qty column.
Like that:
Name  Qty  SQty
John    3    3
Tom    6    9
Yoxan    2    11    
Bob     7    18

Is it possible to create such report or even query? Thank you.


firoz poil replied to Rahim Huseyn on 19-Nov-12 07:38 AM

You can do this in the help of a query. Add a autonumber column in your table if you have alreday ignore this and create a query like:

select aut,name,qty,sold+((select sum(qty) from tbname b where b.aut<a.aut),0)as sqty from sales a order by aut
I hope this help

Rahim Huseyn replied to firoz poil on 29-Nov-12 06:09 AM
Thank you