Hi Everyone this is the original database table
Item_NO | Posting_date | EntryType | LocationCode | Quantity |
I0013078 | 12-2-2013 | 4 | RW003 | -1 |
I0013078 | 12-2-2013 | 4 | INTRNASIT | 1 |
I0013077 | 12-2-2013 | 4 | RW003 | -1 |
I0013077 | 12-2-2013 | 4 | RW003 | -1 |
I0013079 | 12-2-2013 | 4 | INTRNASIT | 1 |
I0013079 | 12-2-2013 | 4 | RW004 | -1 |
I0013078 | 12-2-2013 | 4 | INTRNASIT | 2 |
I0013078 | 12-2-2013 | 4 | RW004 | -2 |
I0013077 | 12-2-2013 | 4 | RW004 | -1 |
I0013077 | 12-2-2013 | 4 | RW003 | -1 |
The expected result table is as below
Item_NO | Posting_date | EntryType | LocationCode | Quantity |
I0013078 | 12-2-2013 | 4 | RW003 | -1 |
I0013078 | 12-2-2013 | 4 | INTRNASIT | 0 |
I0013077 | 12-2-2013 | 4 | RW003 | -1 |
I0013077 | 12-2-2013 | 4 | RW003 | -2 |
I0013079 | 12-2-2013 | 4 | INTRNASIT | -1 |
I0013079 | 12-2-2013 | 4 | RW004 | -2 |
I0013078 | 12-2-2013 | 4 | INTRNASIT | 0 |
I0013078 | 12-2-2013 | 4 | RW004 | -2 |
I0013077 | 12-2-2013 | 4 | RW004 | -3 |
I0013077 | 12-2-2013 | 4 | RW003 | -4 |
Quantity should be accumulate according to each PostingDate
Please anyone help me how to calculate the cumulative quantity as above expected table quantity
Thanks in advance..