Calculated Query using date field

  • Thread starter Thread starter Kathy W
  • Start date Start date
K

Kathy W

Guest
I would like to calculate a persons age on March 1 2002 using the date of birth field. I have entered the expression DateDiff("yyyy",#3/1/02#,[Birthdate]) This gives me the correct age in years with a minus sign in front ie -25, but does not differentiate between birthdates before or after March 1 2002. I would appreciate some help Thanks. Kathy
 
So where do I put iif() ? Thanks for help
 
What do you mean by "does not differentiate between birthdates before or after March 1 2002. "?

For example:
if [Birthdate]< #3/1/02# then
msgbox "Was not born at that time"
else:
msgbox "Is " & DateDiff("yyyy",#3/1/02#,[Birthdate]) & " years old"
end if

Alex

[This message has been edited by Alexandre (edited 02-25-2002).]
 

Users who are viewing this thread

Back
Top Bottom