If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Calculate age from DOB and save into Table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-28-04, 19:30
moss2076 moss2076 is offline
Registered User
 
Join Date: Aug 2004
Posts: 344
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?

Cheers

Tom

Last edited by moss2076; 08-28-04 at 19:36. Reason: spelling mistake
Reply With Quote
  #2 (permalink)  
Old 08-28-04, 20:45
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
see this thread: http://www.dbforums.com/t1008741.html

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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 08-29-04, 06:20
moss2076 moss2076 is offline
Registered User
 
Join Date: Aug 2004
Posts: 344
Ill have a look at that, cheers
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On