Software Venture Consulting
ToMarket

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Brian Dunning
Contact me | vCard


Brian on CNN
Brian on CNN


Brian on CBS Radio


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

Age ( Birth; theDate; Format )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 3.4  (7 votes)
  Discuss this Custom Function

Geoff Wells, DataIsland Software LLC
http://www.dataisland.com

Calculates Age in three formats

Sample Input:
Age ( 5/14/1946; 5/11/2004; 3 )
Sample Output:
57 years and 11 months, and 27 days


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

The Age function will calculate a persons age, on any date, in three different formats -

1 / Years
2 / Years and Days
3 / Years, Months and Days.

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

Can you find it.I hop you cn find it in a good.

william royster, ohio
March 26, 2009 7:45am

Just one little addition to the leap year factor that might be easily forgotten...
The year 2000 is not a leap year, because it's divisible by 400.

Let ( leapFactor = If ( Mod ( Year ( theDate ) ; 4 ) = 0 AND Mod ( Year ( theDate ) ; 400 ) ≠ 0 ; 1 ; 0 );

Alexis Gehrt, Laax / Switzerland
November 30, 2009 8:35am

Sorry, Alexis, but check your calendar again. 2000 WAS a leap year, because it's divisible by 400. The 'century' years are normally not leap years (1800, 1900), except when divisible by 400. So the calc for leapFactor should really be:

leapFactor = Case ( Mod ( Year ( theDate ) ; 400 ) = 0 ; 1 ;
// 'century' years divisible by 400 are leap years
Mod ( Year ( theDate ) ; 100 ) = 0 ; 0 ;
// 'century' years not divisible by 400 are not leap years
Mod ( Year ( theDate ) ; 4 ) = 0 ; 1 ;
// years divisible by 4 are leap years
0 )

Rob Woof, Sydney/Australia
August 08, 2010 7:13pm

There's another way that bypasses the Case statement.

leapFactor = If ( Mod ( Year ( theDate ) ; 400 ) = 0 ; 1 ; 0 ) // 'century' years divisible by 400 are leap years
- If ( Mod ( Year ( theDate ) ; 100 ) = 0 ; 1 ; 0 ) // 'century' years not divisible by 400 are not leap years
+ If ( Mod ( Year ( theDate ) ; 4 ) = 0 ; 1 ; 0 ) // years divisible by 4 are leap years

A year that is divisible by 400 (e.g. 1600, 2000) will evaluate to 1 - 1 + 1 = 1.
A year that is divisible by 100 but not by 400 (e.g. 1300, 1900) will evaluate to 1 - 1 + 0 = 0.
A year that is divisible by 4 but not by 100 (e.g. 1972, 1988) will evaluate to 1 - 0 + 0 = 1.
Any other year (i.e. not a leap year) will evaluate to 0 - 0 + 0 = 0.

Just another way to skin this particular cat.

Rob Woof, Sydney/Australia
August 11, 2010 8:48pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 3 + 9 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. GetResultParameter( ParameterName )
  (Wed, Aug 25, 8:32am)
2. GetListParameter ( ParameterList ; ParameterName )
  (Wed, Aug 25, 8:25am)
3. Standard_Deviation( Field ; MaxLoopCount ; StartIndex ; StdDeviation ; ArithMeanValue )
  (Tue, Aug 24, 10:57am)
4. Arithmetic_Mean ( Field ; MaxLoopCount ; StartIndex ; MeanValue )
  (Tue, Aug 24, 10:51am)
5. Age ( Birth; theDate; Format )
  (Fri, Aug 20, 9:50am)
6. Power ( x ; y )
  (Thu, Aug 19, 5:56am)
7. portal.rowCount ( _name )
  (Sun, Aug 15, 2:41pm)
8. PostPer_Day ( Post; startDate ; finishDate ; returnType )
  (Sat, Aug 14, 2:02pm)

RSS Feed of Custom Functions