Solved

incrementing months

Posted on 2006-06-16
5
249 Views
Last Modified: 2010-05-18
i want to set up a table that will hold a payment plan information. basically:
id no.
start date: 06/01/06 (global)
original amount:  $300.00  (global)
payment day of month: 15
Amount of Payment:  $100.00


i would like to know if there is a way that i use a loop to populate the records for an id no. by putting in the information and having it go through and set up the payment plan until it hits the original amount?

example
Date        Amount
6/15/06   $100.00
7/15/06   $100.00
8/15/06   $100.00
0
Comment
Question by:kauakea
  • 2
  • 2
5 Comments
 
LVL 19

Assisted Solution

by:billmercer
billmercer earned 100 total points
Comment Utility
This sounds fairly straightforward.  

Create globals (or script variables if yoiu're using v8) to hold working values called Balance and DueDate.

Create a script that starts by setting Balance = original amount and set DueDate = start date

Add a loop structure that starts by creating a new record, then compares the Balance to the payment amount.
If the payment amount is less than the Balance, then set that record's payment to the payment amount, and date to the DueDate.
Then subtract the payment amount from Balance and add one month to DueDate.
If the payment amount is greater than Balance, set the payment to Balance instead, and exit the loop.



0
 

Author Comment

by:kauakea
Comment Utility
how do i get the duedate by month. ie december 15, 2005, january 15, 2006, february 16, 2006???
0
 
LVL 19

Expert Comment

by:billmercer
Comment Utility
Don't add a number of days, use FileMaker's date functions to increment just the date portion by one month.
Like this:

MyDate = Date ( Month ( MyDate ) + 1; Day( MyDate ) ; Year( MyDate ) )
0
 
LVL 28

Expert Comment

by:lesouef
Comment Utility
the beauty of this function is that it controls over/underflow itself. if you set january - 1 , it automatically decrement thes year and set the month to december, so you never care about anything else but months. same thing applies to days (to find last day of the month, use date ((1st day of next month) - 1). quite good for invoices due dates...
0
 
LVL 28

Accepted Solution

by:
lesouef earned 400 total points
Comment Utility
just in case, a little example.
http://www.lesouef.net/files/due_dates.fp7
I have done what you need, but I think it would be easier to use if you would set the amount of months to calculate the monthly amount instead doing the opposite...
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now