Solved

incrementing months

Posted on 2006-06-16
5
254 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FM - Mouse Scroll 3 526
Filemaker Output 6 216
Setting up FileMaker Webdirect SSL certificate 11 342
send mail from Filemaker Pro 10 4 104
Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 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

13 Experts available now in Live!

Get 1:1 Help Now