Age ( Birth; theDate; Format )
Rate this function: Average rating: 3.8 (36 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 

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:5 most recent comments  Show all 7 comments Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Newest Custom Functions:
1. 
PreviousMonthEndDate ( myDate ) 

(Wed, Mar 07, 3:35am) 
2. 
PreviousMonthName (myDate) 

(Wed, Mar 07, 3:33am) 
3. 
FmTableFields ( tableName ; fieldsInclude ; fieldsExclude ; classExclude ; typeExclude ; prefixExclude ) 

(Fri, Mar 02, 6:32am) 
4. 
sql.getTable ( fullyQualifiedFieldObject ) 

(Thu, Feb 22, 8:36am) 
5. 
sql.getField ( fullyQualifiedFieldObject ) 

(Thu, Feb 22, 8:34am) 
6. 
FilterOut ( ListA ; ListB ) 

(Wed, Feb 21, 6:11pm) 
7. 
Char0 ( ) 

(Sun, Feb 18, 2:35am) 
8. 
CreateVCardFile ( FirstName ; LastName ; CompanyName ; Phone ; Email ; WEB ; hAddress1 ; hAddress2 ; hZip ; hCity ; hCountry ; wAddress1 ; wAddress2 ; wZip ; wCity%2 

(Sun, Feb 18, 1:50am) 


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