What are sundry accounts? In transactions table are debit and credit amounts only!
I think the way to go is to calculate all fields needed for report in checks table - all in single row. A possible schema will be:
1. You need to estimate the number of needed report rows for every check. And you have to decide the max number of check rows in report;
2. In checks table instead columns for major accounts separately for debit and credit, you must have also group(s) for sundry accounts. And you have every of those accounts for report row numbers from 1 to max report row. Also you must have an additional 1-row Table at top of those calculated columns, where the according report row number is stored (like the Table where according accounts are currently stored);
3. In report, you must have some hidden columns, where
a) the number of check is stored (from 1 to max number or checks in report month on checks sheet), repeated for number of report rows in checks table (like 1, 2, 2, 3, 4, 4, 4, ...);
b) the number of check row is stored (from 1 to number of check rows in checks table).
From there on, you read info from proper columns on check table into report (you must have enough rows prepred for report - before printing you can use autofilter to hide empty rows.
|