Results 1 to 3 of 3
  1. #1
    mick is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    1

    Talking Calculate age from birth date

    Hi, I need for the age of the patients to change as their birth day passes or when I enter the date of birth to automatically give me the age. Also when a patient is from "1923", for example, or older, the date skips to "2023".



    I would really apretiate your help here, Thanks in advance.

    Mick

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    look up the datediff() function

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here you go:
    Code:
    Public Function Age(DOB As Date) As Integer
        Age = DateDiff("yyyy", DOB, Date) + (Date < DateSerial(Year(Date), Month(DOB), Day(DOB)))
    End Function

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

Similar Threads

  1. Calculate Interest
    By jgelpi16 in forum Queries
    Replies: 3
    Last Post: 08-19-2016, 08:01 PM
  2. Replies: 5
    Last Post: 05-05-2010, 04:31 PM
  3. Calculate avg in a report
    By bob006 in forum Reports
    Replies: 1
    Last Post: 11-18-2009, 06:31 PM
  4. Replies: 0
    Last Post: 10-28-2007, 09:11 PM
  5. calculate holidays
    By barkarlo in forum Queries
    Replies: 0
    Last Post: 12-20-2006, 06:08 AM

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