Hi,
I have a bit of a tricky problem that I would appriciate some help with.
I am writing a report to calculate aged outstanding payments on invoices. This needs to be able to report on the details for a historical period. This is achived by taking the remaining amount (ie outstanding) and adding back historical payments already made.
The problem that I have is that due to the historical payments being held in multiple lines by date on a second table, I have a one to many join structure. This therefore duplicates the actual remaining amounts.
ie
Document Code Remaining Payments Made
1 1000.00 100.00
2 1500.00 50.00
2 1500.00 500.00
3 450.00 100.00
3 450.00 150.00
3 450.00 200.00
So the values I wish to retrieve are
1 - 1000.00 100.00
2 - 1500.00 550.00
3 - 450.00 450.00
To complicate matters further, I need to sum the remaining amounts by document, supplier, currency, Company and age these by due date.
I have tried many ways to get this data out but when I create the totals, I get 5,350 rather than 2,950.
Is there a way to do this or is it just too complex.
Oh - and I am unable to change the tables, add new ones or modify the database in any way.
Thanks
I have a bit of a tricky problem that I would appriciate some help with.
I am writing a report to calculate aged outstanding payments on invoices. This needs to be able to report on the details for a historical period. This is achived by taking the remaining amount (ie outstanding) and adding back historical payments already made.
The problem that I have is that due to the historical payments being held in multiple lines by date on a second table, I have a one to many join structure. This therefore duplicates the actual remaining amounts.
ie
Document Code Remaining Payments Made
1 1000.00 100.00
2 1500.00 50.00
2 1500.00 500.00
3 450.00 100.00
3 450.00 150.00
3 450.00 200.00
So the values I wish to retrieve are
1 - 1000.00 100.00
2 - 1500.00 550.00
3 - 450.00 450.00
To complicate matters further, I need to sum the remaining amounts by document, supplier, currency, Company and age these by due date.
I have tried many ways to get this data out but when I create the totals, I get 5,350 rather than 2,950.
Is there a way to do this or is it just too complex.
Oh - and I am unable to change the tables, add new ones or modify the database in any way.
Thanks