Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code for obtaining birthyears

Status
Not open for further replies.

SoClueless

Technical User
Nov 28, 2000
49
US
Does anyone know how to do this? I have a list of over 2,000 children, their ages, and the date these were obtained. Is there a way to come up with a date-of-birth globally, instead of having to calculate each one individually? Thank you.
 
no real way. If you do not "know" the month and day (of the month), at best you can get to +/- one year. The 'confusion' arises (obviously?) because you do not know wheather the age was obtained before of after the 'birthday'.

So a reasonable approximation would just be the year of the recording minus the age at hte time of the recording. It may be possible to refine this slightly with the asssumption that for recording dates after 182nd day of the year, the birthday has passed, and prior to that, it has not. You COULD even extend this down to months (or even DAYS) with some sophisticated stasticts - but finally, you will not get the actual birthdate without recourse to external documentation.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Try this:
Birthdate = DateAdd("yyyy",-[Age],[Date Obtained])

You can put it in a calculated query field.
Ken
 
Hi,

Understand..obviously can't get the actual date, but I'd be happy if I could just get a year, (plus or minus one year not a problem at this point) for them for the time being, then our development people could target age groups for sending out mailings that might just be of interest to certain ages of kids. Would I do it in a query or do I have to go into sql? And of course I'll ask the people gathering data this year to start getting birthdates from now on, pleez. Thanx again.
 
Age = 22
RecordDate = #8/21/42#
BirthYr = Year(RecordDate) - Age

? BirthYr
1920

'In a query
BirthYr: Year([RecordDate]] - [Age])

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top