Hi,
I have a table of data relating to payments made on behalf of members. This is a single table, as I have already summarized the data for the required group of people and for specified contract year.
I need to extract data for the first £300 paid against each person. I also need this to be split down by date paid. If a single payment takes the total from under £300 to over £300, then rather than show the full paid amount, I need it to just make it up to £300 exactly.
For simplicity, just assume the following fields:
PersonID
DatePaid
AmountPaid
This could include many records, with vary numbers and amounts of payments, upto any value possible.
I am looking for a result that may look something like this:
PersonID DatePaid AmountPaid ReportAmount
0001 05/01/04 £270 £270
0001 23/02/04 £120 £30
0002 03/03/04 £570 £300
0003 26/02/04 £50 £50
0004...
You get the idea.
Anyway, I have not quite managed to get my head around the best way to do this. Any ideas/ suggestions would be very much appreciated.
Thanks,
Simon
I have a table of data relating to payments made on behalf of members. This is a single table, as I have already summarized the data for the required group of people and for specified contract year.
I need to extract data for the first £300 paid against each person. I also need this to be split down by date paid. If a single payment takes the total from under £300 to over £300, then rather than show the full paid amount, I need it to just make it up to £300 exactly.
For simplicity, just assume the following fields:
PersonID
DatePaid
AmountPaid
This could include many records, with vary numbers and amounts of payments, upto any value possible.
I am looking for a result that may look something like this:
PersonID DatePaid AmountPaid ReportAmount
0001 05/01/04 £270 £270
0001 23/02/04 £120 £30
0002 03/03/04 £570 £300
0003 26/02/04 £50 £50
0004...
You get the idea.
Anyway, I have not quite managed to get my head around the best way to do this. Any ideas/ suggestions would be very much appreciated.
Thanks,
Simon