Various of previous Amount - Microsoft Community
- Get link
- X
- Other Apps
hi,
please if know this. need calculate previous dates total amount attached image. how can create query or report access
thanks,
you'll find examples of how compute balances in query in balances.zip in public databases folder at:
https://onedrive.live.com/?cid=44cc60d7fea42912&id=44cc60d7fea42912!169
note if using earlier version of access might find colour of form objects such buttons shows incorrectly , need to amend form design accordingly.
if have difficulty opening link copy text (nb, not link location) , paste browser's address bar.
little demo file illustrates methods computing balances in variety of contexts. report, updatable recordset not needed, join of 2 instances of table efficient method. appropriate example in demo in case is:
select t1.customerid, t1.transactiondate, t1.transactionamount,
sum(t2.transactionamount) balance
transactions t1 inner join transactions t2
on (t2.transactionid<=t1.transactionid or t2.transactiondate<>t1.transactiondate)
, (t2.transactiondate<=t1.transactiondate)
group t1.transactiondate, t1.transactionamount, t1.transactionid, t1.customerid
order t1.transactiondate desc , t1.transactionid desc;
note table must have primary key column, transactionid in above, acts tie-breaker 2 transactions take place on same day. if table not have such column, add autonumber column key.
however, values posted in screenshot not make sense. instance have credit balance of 720.00 following debit transaction of -120.00 previous balance 600.00. balance should 480.00. following row has debit balance of -205.00 following credit transaction of 925.00. should 1405.00. , on….
https://onedrive.live.com/?cid=44cc60d7fea42912&id=44cc60d7fea42912!169
note if using earlier version of access might find colour of form objects such buttons shows incorrectly , need to amend form design accordingly.
if have difficulty opening link copy text (nb, not link location) , paste browser's address bar.
little demo file illustrates methods computing balances in variety of contexts. report, updatable recordset not needed, join of 2 instances of table efficient method. appropriate example in demo in case is:
select t1.customerid, t1.transactiondate, t1.transactionamount,
sum(t2.transactionamount) balance
transactions t1 inner join transactions t2
on (t2.transactionid<=t1.transactionid or t2.transactiondate<>t1.transactiondate)
, (t2.transactiondate<=t1.transactiondate)
group t1.transactiondate, t1.transactionamount, t1.transactionid, t1.customerid
order t1.transactiondate desc , t1.transactionid desc;
note table must have primary key column, transactionid in above, acts tie-breaker 2 transactions take place on same day. if table not have such column, add autonumber column key.
however, values posted in screenshot not make sense. instance have credit balance of 720.00 following debit transaction of -120.00 previous balance 600.00. balance should 480.00. following row has debit balance of -205.00 following credit transaction of 925.00. should 1405.00. , on….
Office / Access / Windows 10 / Office 2013
- Get link
- X
- Other Apps
Comments
Post a Comment