I am stuck, and was able to get some great help the last time I came to this forum, so I am hoping for the same luck this time!!
classes
- classid
- weekday (list weekday a class falls on every week)
- startdate
I am trying to write a script that calculates the number of times a weekday falls in each month (will be used every month) starting from the startdate of the class. I have all the other calculations and fomulas written but I am stumped at the best way to calculate this.
In more broken down terms, this is what I am trying to find using "Sue" as an example:
Sue has a class that she started on 10/08/2009 and John started on 10/01/2009, and their lesson weekday is Thursdays, at $10 a lesson. In all of October, there are 5 Thursdays, but Sue should only be billed for 4 since she started a week into October. John, however, should be billed for 5 since he started the first week in October. So Sue's total for October would be $40, but John's should be $50.
I have no idea where to even start with this, any help at all is greatly appreciated.