Solved

incrementing months

Posted on 2006-06-16
5
250 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
ID: 16924611
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
ID: 16924623
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
ID: 16925099
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
ID: 16925586
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
ID: 16925909
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

15 Experts available now in Live!

Get 1:1 Help Now