Running totals:

Hey all,trying to get running totals with the following query:

select sum(AmountMST) from trans

where trans.AccountId == this.AccountId && trans.TransDate <= this.TransDate;

The problem is i get same values for the same dates such as:

1-date1-1-1

1-date2-1-3

1-date2-1-3

It’s supposed to be :

1-date1-1-1

1-date2-1-2

1-date2-1-3

How can I achieve this? There is also a third column that i can use to identify dates