I think the problem is that I don't understand the logic you're using to determine the months to use. (if mth_00 is the current month, and mth_01 is the previous month, I'd have actually expected you to count from 0 out to the number of months back that you want, and the current date to be insignificant in the calculation)
Anyway, just figure out which mth_xx fields you want, and adjust the line that sets @months_of_support so the logic is correct.
| [reply] [d/l] |
Don't get me wrong, your code works great, but the dates are not correct. Let me see if I can explain it better. The second calculation needs to begin 1 year back + 1 month and march towards the current month for the # of months equal to # of days/30. For example, assuming the current month is 11/06 and # of days = 120, the beginning month would be 1 year back (11/05) + 1 month so it would be 12/05 and would sum months (12/05 + 01/06 + 02/06 + 03/06).
Here's how the table is setup:
mth_00 = current month (11/2006)
mth_01 = 10/2006
mth_02 = 09/2006
mth_03 = 08/2006
mth_04 = 07/2006
mth_05 = 06/2006
mth_06 = 05/2006
mth_07 = 04/2006
mth_08 = 03/2006
mth_09 = 02/2006
mth_10 = 01/2006
mth_11 = 12/2005
mth_12 = 11/2005
mth_13 = 10/2005
mth_14 = 09/2005
etc...
Here's the date ranges for each of the months (assume # of days = 120)
If current month = 11, month range should be 8,9,10,11
If current month = 10, month range should be 9,10,11,12
If current month = 09, month range should be 10,11,12,13
If current month = 08, month range should be 11,12,13,14
If current month = 07, month range should be 12,13,14,15
If current month = 06, month range should be 13,14,15,16
etc...
| [reply] [d/l] |
If anyone can help me with this I'd greatly appreciate the help. I'm stuck!
| [reply] |