5 Replies Latest reply on Mar 5, 2012 2:35 PM by philmodjunk

# Birth date from number string

### Title

Birth date from number string

### Post

Hi,

Could anyone help me with this one.

In one field I have 11 digit number  for example 84031202450

and the first six digits is the date of birth yy/mm/dd - 12 mar 1984. How can I calcluate in another field the date of birth?

ThanK you!

• ###### 1. Re: Birth date from number string

Let ( [ S = YourNumberStringfield;
Y = Left ( S ; 2 ) ] ;
Date ( Middle ( s ; 3 ; 2 ) ; Middle ( s ; 5 ; 2 ) ; If ( Y > 12 ; 1900 ; 2000 ) + Y )
)

And you could use Right ( Year ( Get ( CurrentDate ) ) ; 2 ) in place of 12 if you need to use this in future years.

• ###### 2. Re: Birth date from number string

but with 84031202450 i get 724347 in the calculation field

• ###### 3. Re: Birth date from number string

Make sure that you select "date" as the calculation's result type instead of number.

• ###### 4. Re: Birth date from number string

Could You please tell me if I can Have AGE

from currentdate - birthdate calculated from the string above  and the Age does not updates as the time pass ?

Thank You very much!

• ###### 5. Re: Birth date from number string

Use the date field calculation to get birthdate as a date, then use this calculation:

Let ( [ B = YourBirthdateField ;
T = Get ( currentdate ) ;
BD = Date ( Month ( B ) ; day ( B ) ; Year ( T ) ) // date of this year's birthday
] ;

Year ( T ) - Year ( B ) - ( BD > T )
)

If you define this in a a calculation field with date selected as the return type (not a date field using this expression as an auto-entered calculaiton) and select "unstored", the age will update automatically as time passes. If you use an auto-enter field or a stored calculation, it will not update.