opening balance updation query in report(MS nav)

i am trying to make a report.

in the data item i have one table,1-stock billing table

and the fields are


document no. posting date Qin(purchase) Qout(sales) opening balance

101 31/08/10 100 100

102 28/08/10 65 35

103 25/08/10 50 -15

104 22/08/10 45 30

105 20/08/10 85 115

While using the date filter i am not getting the updated balance.

lets say ,i want opening balance from date 25/08/10 to date 20/08/10,instead of displaying -15 at the opening balance my report shows 50 at the opening balance,how could i achieve -15 at the opening balance.

somebody could help,please.

It’s obvious - as you filtered out all transactions before 25/08/10 how do you expect your opening balance will be correct (-15 in this example) ???

You need to calculate the opening balance first, it can’t appear from nowhere by itself - and then initiate the running total with this value before adding transactions on & after “from” date…