Hi all,

Here is how to do it as a dictionary I-type. It is trivial to convert this for a "normal" program. The code below works for the nasty cases of doing it on Feb 29 or for someone born on that date.

OCONV(DATE(),'D4YMD'); OCONV(DOB,'D4YMD'); @1[1,[EMAIL PROTECTED],4];
IF @1[6,5] GE @2[6,5] THEN @3 ELSE @3 - 1

This is made up of four simple expressions.
7 The first gets the current date and formats it as YYYY MM DD. This result is stored in the variable @1. 7 The second formats the date of birth in the same way. This result is stored in the @2 variable. 7 The third simple expression subtracts the year of birth from the current year. The result is stored in @3. 7 The final expression determines whether the current date is before the birthday and, if so, modifies the calculated age.


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB
+44-(0)1604-709200 -------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to