Suppose I have two table same as above
Accounts
ACCTID
ACCTNAME
ACCT TYPE
Opening Balance
Date
12
CASH ACCT
DEBIT
1200
1-4-2023
13
BANK ACCT
1300
14
SUPPLIER ACCT 1
CREDIT
1400
15
SUPPLIER ACCT 2
800
16
EXPESNES1
900
Transactions Table
Accno
Acct Name
Acct Type
Debit amt
Credit amt
5000
0
1000
1-4-023
2000
2-4-2023
200
BBANK ACCT
4000
300
3-4-2023
SUPPLIER ACCT
400
4-4-2023
I HVE TO DISPLAY VALUE LIKE THIS
Opening balance will show according to credit and debit acct type for example
From date : 2023-04-01 to date 2023-04-02
Acct name
Opening balance(cr)
Opening balance (dr)
Credit(sum)
Debit(sum)
Closing credit
Closing debit
Casah acct
6000
5200
Bank acct
600
4700
Supplier acct
700
100
2200
Supplier acct2
1800
Opening balance will show debit side and credit side according to account type
And opening balance will be change according to date . I mean closing balance will become to opening balance on next date
I have to display the record according to date range wise (date between wise )
Please help me in this situation I will highly thank full to you