Calculating age from 2 dates

lesley

New member
Local time
Today, 02:41
Joined
Dec 2, 2001
Messages
6
This is probably really simple but I'm having difficulty in calculating a subjects age from the interview date and their date of birth. I want to automatically display their age so that it can be carried onto another form to eliminate various questions.

I was trying to do this in visual basic but couldn't quite figure it out from the help display of DateDiff

Please help

Thaks
 
What format do you want the answer? Only years or years and months ......
 
year only should be fine, I really only need to know if they are less than or equal to 56 years of age
 
OR :!!

If DateAdd("y", 57, Birthday) < Now then
MsgBox "Has passed 57th birthday"
else
msgbox "Young enough"
end if
 
Being you are wanting the "age at the date of interview" ... not the "age based on todays date" .... try this:

DateDiff("yyyy", [DOB], [IDate]) + ([IDate] < DateSerial(Year([IDate]), Month([DOB]), Day([DOB])))

"DOB" should be the "Date of Birth" information and "IDate" should be the "Interview Date" information.

HTH
RDH

[This message has been edited by R. Hicks (edited 01-04-2002).]
 

Users who are viewing this thread

Back
Top Bottom