Gday all,
Scenario: I want to find the last day of the month when a customer payment is due based on two criteria i) Number of days (an INT field) ii) a datetime field.
The new date will calculate based on the number of days from the next month, i.e the 1st of the next month, then add the days (assuming 30 means a whole month, so I can't just add the days, I need to to add a whole month).
For example (using dates as dd/mm/yyyy)
Days First Date New Date
30 05/06/2004 31/07/2004
30 20/08/2004 30/09/2004
45 13/08/2004 15/10/2004 or 16/10/2004 (either is OK)
60 05/06/2004 31/08/2004
60 21/11/2004 31/01/2005
75 21/11/2004 15/02/2005 or 16/02/2005 (either)
Is this example clear?
I've already taken a stab at the code, but it became a real mess, so instead of pasting what I've done here and maybe influencing your code, have a go yourself & I can compare.
cheers
Danster
Scenario: I want to find the last day of the month when a customer payment is due based on two criteria i) Number of days (an INT field) ii) a datetime field.
The new date will calculate based on the number of days from the next month, i.e the 1st of the next month, then add the days (assuming 30 means a whole month, so I can't just add the days, I need to to add a whole month).
For example (using dates as dd/mm/yyyy)
Days First Date New Date
30 05/06/2004 31/07/2004
30 20/08/2004 30/09/2004
45 13/08/2004 15/10/2004 or 16/10/2004 (either is OK)
60 05/06/2004 31/08/2004
60 21/11/2004 31/01/2005
75 21/11/2004 15/02/2005 or 16/02/2005 (either)
Is this example clear?
I've already taken a stab at the code, but it became a real mess, so instead of pasting what I've done here and maybe influencing your code, have a go yourself & I can compare.
cheers
Danster