Database Reference
In-Depth Information
Math with Dates and Times
Because FileMaker looks at dates and times as numbers, you're free to use them right along
with other numbers and operators in all kinds of mathematical functions. By adding, sub-
tracting, multiplying, and dividing dates, times, timestamps, and numbers, you can come up
with meaningful results.
Dates
You can use the information in your database's date fields to have FileMaker figure out due
dates, anniversaries, and so on. You can use date fields and numbers interchangeably.
FileMaker is smart enough to figure out that you want to add whole days to the date value
it's storing. Here are some general principles:
▪ To get a date in the future or past, add or subtract the number of days. For example, if
your policy is that payments are due 10 days after invoices are presented, then, in your
Date Due field, use this calculation:
Invoice Date + 10
▪ Of course, you aren't limited to adding constant numbers to dates. You can add the value
in a number field to the value in a date field just as easily. If your video rental database
holds the checkout date and the rental duration, you can find the due date with this calcu-
lation:
Checkout Date + Rental Duration
▪ To get the number of days between two dates, subtract them.
Suppose your registration database holds arrival and departure dates. You can find the
duration of the stay (in days) using this calculation:
Departure Date - Arrival Date
NOTE
When you're adding a number to a date, the result is a brand-new date, and you should set the result
type of your calculation accordingly. On the other hand, if you're subtracting two dates, the result is
a number—the number of days between the two dates. In this case, set your calculation to return a
number result.
Search WWH ::




Custom Search