Results 1 to 4 of 4
  1. #1
    kbrodrick is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    1

    Math problem

    I want to calculate a persons age from the fields Date of Birth and Date of Death.
    I have been able to get it to calculate the years but if DOD was before their birthday it is one year off. I can't seem to get it right. this is what i have that calculates it so far.
    =DateDiff(“YYYY”,[Date of Birth],[Date of Death])

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try:
    =DateDiff("yyyy", [Date of Birth], [Date of Death])+ Int( Format([Date of Death],"mmdd") < Format( [Date of Birth], "mmdd") )

  3. #3
    tinytree is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2009
    Posts
    28
    expert's idea! very great!

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad we could help. Try the link in my sig.

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums