I have got two tables:Table 1: InwardsID | InDate | InwardAmount | ...
Table 2: OutwardsID | OutDate | OutwardsAmount | ...
I need the following output:Date | Debit | Credit | TotalAmount | ...
This output would be having entried from both the tables.Date -> InDate / OutDateDebit -> InwardAmount [from Inwards]Credit -> OutwardsAmount [from Outwards]TotalAmount -> ??Calculation of TotalAmount is a bit tricky:TotalAmount = Balance - debit + creditIf the month is April [start of fiscal year] thenBalance = 0 elseBalance = Balance - debit + credit [of the previous entry]