+1 800 256 3608 (toll-free in North America) or +49 7531 90 60 10| service@combit.com

Birthday: Expression for Calculating the Age

designer
(combit Team) #1
Valid from List & Label 7
Following expression calculates the age from a BIRTHDAY variable (of L&L type 'date'):
Cstr$(Year(Today()) - Year(BIRTHDAY) - if(DateToJulian(DateYMD(1, Month(Today()), Day(Today()))) - DateToJulian(DateYMD(1, Month(BIRTHDAY), Day(BIRTHDAY))) < 0,1,0), "%25.0f")


You can use this expression in reports to print persons’ ages when just knowing their birthday.

Important:
This expression considers automatically whether the birthday already has happened this year or not. This may not be useful when being used for “Happy Birthday” cards, because there you’ll need the “new” age, not the current. For this purpose use the following expression:

Cstr$(Year(Today()) - Year(BIRTHDAY), "%25.0f")
IDKBTE000586 KBTE000586