Criteria for age calculation

  • Thread starter Thread starter Deeds37
  • Start date Start date
D

Deeds37

I have a simple query Name and Date of Birth. I want to calculate the age in
a query. I have tried different criteria from MS Access Tutorials. Can
someone please help me with a correct criteria to calculate the contacts age
as of today from the date of birth.

Thanks,

Deeds37
 
Deeds37,

Without seeing what you tried... can you tell me why the below didn't work
for you?

=DateDiff("yyyy", [YourBirthDateField], Now())+ Int( Format(Now(), "mmdd") <
Format( [YourBirthDateField], "mmdd") )


--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I have a simple query Name and Date of Birth. I want to calculate the age in
a query. I have tried different criteria from MS Access Tutorials. Can
someone please help me with a correct criteria to calculate the contacts age
as of today from the date of birth.

Thanks,

Deeds37
 
Thanks Gina,
I put this formula in a text box in a form and it works. What I am looking
for is when I write a simple query - Name, Date of Birth........I want it to
calculate the age. Do I put this formula in criteria under date of birth?
 
Deeds37 said:
I have a simple query Name and Date of Birth. I want to calculate the age
in
a query. I have tried different criteria from MS Access Tutorials. Can
someone please help me with a correct criteria to calculate the contacts
age
as of today from the date of birth.

Thanks,

Deeds37
 
Deeds37,

Post the SQL of your query here... it should work in a query.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Thanks Gina,
I put this formula in a text box in a form and it works. What I am looking
for is when I write a simple query - Name, Date of Birth........I want it to
calculate the age. Do I put this formula in criteria under date of birth?
 
Thanks Gina,
I put this formula in a text box in a form and it works. What I am looking
for is when I write a simple query - Name, Date of Birth........I want it to
calculate the age. Do I put this formula in criteria under date of birth?

No: put it in a vacant Field cell in the query grid. Putting it under the date
of birth will give you a "criterion" which will end up selecting no records at
all.
 
Back
Top