I'm having a table DailyTransaction, it contains day to day shop transactions like sales, purchase, bank Receipts and Vouchers and Expense Vouchers, etc.,
Main Table: DailyTransaction
SNo Mode title
---------------------------------------
1 1 Sales
2 1 Sales
3 3 Bank Payment
4 2 Purchase
5 1 Sales
6 2 Purchase
7 2 Purchase
8 1 Sales
9 3 Bank Payment
Table: Sales
SNo DSNo Amount
---------------------------------------
101 1 200
102 2 500
103 5 800
104 8 250
Table: Purchase
SNo DSNo Amount
---------------------------------------
201 7 850
202 6 525
203 7 650
Table: Bank
SNo DSNo Amount
------------------------------------
301 3 450
302 9 875
My Requirement is
SNo Mode title DSNo Amount
-----------------------------------------------------------------
1 1 Sales1 101 200
2 1 Sales 102 500
3 3 Bank Payment 301 450
4 2 Purchase 201 850
5 1 Sales 103 800
6 2 Purchase 202 525
7 2 Purchase 203 650
8 1 Sales 104 250
9 3 Bank Payment 302 875
The Column DSNo
is a Primary SNo
Column of main table DailyTransaction Column Mode specifies the type of transaction.
Kindly assist me how to get the expected output?