I have a report that is made from data in 2 tables.
My date format is Y-M-D
One table has income data the other expenses.
I made queries from these two tables with sums of each transaction.
I have union query:
Then I made a query that combines all data fields I need in my report:
My problem is that:
If for example a certain date like 2008-01-02 has
1 income documents.
2 expense documents.
I get duplicate rows for income documents because access shows a row for every document and because that date had 2 expense documents it must have 2 rows, but why it duplicates the income two items.
Tried using report grouping feature to no avail, I still get 2 date fields and grouping makes no sense here.
Obviously the running sum shows nonsense, and it gets even more weird if for certain date there are like 10 income documents and 2 expense.
-------------------------
I think I would need to use sub report feature to include 2 separate reports? but how do I calculate total running sum then. running sum income - running sum expenses?
My date format is Y-M-D
One table has income data the other expenses.
I made queries from these two tables with sums of each transaction.
I have union query:
PHP:
Select
Data
From kio_group
UNION Select
Data
From kpo_group;
Then I made a query that combines all data fields I need in my report:
PHP:
SELECT Query3.Data, kio_group.KIO, kio_group.[Isduoti:], kio_group.SumOfSavikaina, kpo_group.KPO, kpo_group.[Priimta is:], kpo_group.[Kaina su PVM]
FROM (Query3 LEFT JOIN kpo_group ON Query3.Data = kpo_group.Data) LEFT JOIN kio_group ON Query3.Data = kio_group.Data
GROUP BY Query3.Data, kio_group.KIO, kio_group.[Isduoti:], kio_group.SumOfSavikaina, kpo_group.KPO, kpo_group.[Priimta is:], kpo_group.[Kaina su PVM];
My problem is that:
If for example a certain date like 2008-01-02 has
1 income documents.
2 expense documents.
I get duplicate rows for income documents because access shows a row for every document and because that date had 2 expense documents it must have 2 rows, but why it duplicates the income two items.
Tried using report grouping feature to no avail, I still get 2 date fields and grouping makes no sense here.
Obviously the running sum shows nonsense, and it gets even more weird if for certain date there are like 10 income documents and 2 expense.
-------------------------
I think I would need to use sub report feature to include 2 separate reports? but how do I calculate total running sum then. running sum income - running sum expenses?
Last edited: