Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Sep 2002
    Location
    Brookings, South Dakota, USA
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calculate Age (2002)

    I need to be able to calculate how old students were when they graduated. I've seen several posts to find the current age but nothing for this. I have birthdate and dategraduated fields. TIA, Tammy

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Calculate Age (2002)

    Do you need to know the age in just years, or years and months, or years, months and days?

    It is easier if you just want years, because it will either be Year([dategraduated]) - Year([birthdate]), or one less than that , depending on whether they graduated before or after their birthday .

    So :
    <pre>Function fnAgeinYears(BirthDate as date, DateGraduated) as integer

    if ( Dateserial(Year(DateGraduated),Month(BirthDate), Day(BirthDate)) < DateGraduated ) then
    fnAgeinYears = Year([Dategraduated]) - Year([Birthdate])
    else
    fnAgeinYears = Year([DateGraduated]) - Year([BirthDate]) -1
    end if
    </pre>

    end function
    Regards
    John



  3. #3
    2 Star Lounger
    Join Date
    Sep 2003
    Location
    London, Gtr London, United Kingdom
    Posts
    153
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calculate Age (2002)

    Hi

    I have something I picked up somewhere written by a guy called Roger Carlson which may help you, it is too big to post here though, if you want to give me your electronic mail address I would be glad to send it to you.

    Steve

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calculate Age (2002)

    Here's a link to Roger's website: http://www.rogersaccesslibrary.com/T...Contents2k.asp. You can download his date stuff sample database there.
    Charlotte

  5. #5
    Lounger
    Join Date
    Sep 2002
    Location
    Brookings, South Dakota, USA
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calculate Age (2002)

    Thank you all, Roger had just what I needed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •