Hi all,
I Know many of you were searching for how to make a balance sheet, I myself had searched for it and I finally got it working.
Here is the description an code:
Notes:
You can prepare it using "custom view" only, I don't know the reason it was not working with "View".
First I created a tabel name "dailycashreport" with fields ID(Auto Increment), Date, Remarks, Category, SubCategory, Credit, Debit
First I dont understand much about how it is working, if any experts chose to explain, that will be good.
in the formula there was a string called @rt which was giving error in view but working in custom view.
================
SELECT dailycashreport.ID AS ID,
dailycashreport.Date AS Date,
dailycashreport.Remarks AS Remarks,
dailycashreport.Category AS Category,
dailycashreport.SubCategory AS SubCategory,
Concat(Format(dailycashreport.Credit, 2), ' KZT') AS Credit,
Concat(Format(dailycashreport.Debit, 2), ' KZT') AS Debit,
Concat(Format((@rt := @rt + Coalesce(dailycashreport.Credit, 0) -
Coalesce(dailycashreport.Debit, 0)), 2), ' KZT') AS Balance
FROM dailycashreport,
(SELECT @rt := 0) rt
ORDER BY Date,
ID
================
I hope this helps someone and also some experts can explain how it is works.
Please do comment your review and any ideas are also appreciated.
I used this table to get records as i insert data in another table, so i used 1 more field in my original table called it M_ID, so it can be used for update and delete of record here when i update the another table record.