How can I calculate the age of a child based on birthdate?

R

Rick B

DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(
),"mmdd"))
 
G

Guest

I guess that I need more help. Can you tell me where I need to enter this?
Does this need to be entered as a number? It has been years since I've
worked with Access and my memory isn't recalling a whole lot. Thanks!

Rick B said:
DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(
),"mmdd"))
 
R

Rick B

You would enter it in an unbound text box on your form or report.

You can also do it in a query by creating a new column and giving it a name,
a colon, then the formula. For example...

CurrentAge:
DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(
),"mmdd"))


If you do that, then "CurrentAge" will be an available field in any form or
report that you build using this query as the data source.

--
Rick B



bgregory said:
I guess that I need more help. Can you tell me where I need to enter this?
Does this need to be entered as a number? It has been years since I've
worked with Access and my memory isn't recalling a whole lot. Thanks!

Rick B said:
DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(
),"mmdd"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top