[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

incrementing months

Posted on 2006-06-16
5
Medium Priority
?
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 19

Assisted Solution

by:billmercer
billmercer earned 400 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 1600 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

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

656 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