person's age - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

person's age

rs51rs51 Posts: 2Member
I want to return a person's age, in years, given the birth date. I have a text box where the age lies:
text1.text = 24.2.89
And i want to retrieve her age.
The code i'm using returns stupid ages (ex: -354)
Here goes my code:
Label1.Caption = Int(DateDiff("y", CDate(Text1.Text), Date) / 365.25)
Can anyone help, please?

Comments

  • JomacJomac Posts: 231Member
    : I want to return a person's age, in years, given the birth date. I have a text box where the age lies:
    : text1.text = 24.2.89
    : And i want to retrieve her age.
    : The code i'm using returns stupid ages (ex: -354)
    : Here goes my code:
    : Label1.Caption = Int(DateDiff("y", CDate(Text1.Text), Date) / 365.25)
    : Can anyone help, please?
    :

    It works fine, just a type mismatch
    try entering date like:
    [code]
    24 Feb 1989 or 24/2/89
    [/code]

    Regards,

    ______
    [size=2][b][blue]J[/blue]omac.[/b][/size]

Sign In or Register to comment.