dynamically create recurring dates
Hey guys...I honestly don't know where to start.
1. I need to do is select the "startingdate"column entry for a particular user then run a code that will generate and output that date every months a due date.
2. Inset payments into the generated report from the payments table for specific user.
3. Calculate the difference between the entries that are either due date to due date or between the payments and due date.
There are several ways to do this.
One way is to just calculate the starting date and subsequent due dates all in PHP (or JSP or ASP) code and then use code to check whether the next payment in line (coming from a DB table) is before, on, or after the due date. That's really not hard to do once you figure out the algorithm (logic) of it.
Another way is to create a separate table that has every possible date in it for the next few years. Dirt simple table:
Then, to pick up all the due dates you can write a query that joins that table to your payments table. Say the payment is due on the 13th of the month. So you just do (example onlyl)
|All times are GMT +1. The time now is 02:46 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.