Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004

    Calculate age from DOB and save into Table

    I have a form which displays a basic table (personal_information) which has fields holding peoples information - eg name, address, DOB.

    When viewing the form of the table (personal_information), I want a text box called 'age' to automatically display the age of the person from their DOB and save it into the personal_information table, thus completing their name, address, DOB and now age.

    1)Table called Personal_information - Name(complete), address(complete), dob(01/01/90), age(empty)
    2)Run the Form of the table personal_information with empty age
    3)Automatically update and save the table while the form is open to calculate and save the age in the personal_information table.

    Ive got a query of the table to work out the age and ive created a form of it, but the query doesnt save the age into the original personal_information table.

    Any help for a beginner?


    Last edited by moss2076; 08-28-04 at 20:36. Reason: spelling mistake

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    see this thread:

    i would advise against storing the age

    you can calculate it easily any time you want

    but if you store it, you have to scan your entire table (e.g. every day) to update the age for anyone who's had a birthday since the last time you scanned it

    don't store the age | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Aug 2004
    Ill have a look at that, cheers

Posting Permissions

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