Hello, i have 11 digits number, example 37704252536. Its personal code and boldet&underlined digits are birth date. Me needs that I can from this numer to calculate age a person. How I can do it?
Hello, i have 11 digits number, example 37704252536. Its personal code and boldet&underlined digits are birth date. Me needs that I can from this numer to calculate age a person. How I can do it?
Try this function in a standard module:
Code:Function ReturnAge(InString As String) As Integer Dim DOB As Date DOB = DateValue(Mid(InString, 4, 2) & "/" & _ Mid(InString, 6, 2) & "/" & _ Mid(InString, 2, 2)) ReturnAge = DateDiff("yyyy", [DOB], Date) + _ Int(Format(Date, "mmdd") < Format([DOB], "mmdd")) End Function