DateDiff Age in Years and Months

G

Guest

Is there an easy way to show that Sally is 2 years and 4 months old? My best
attempt so far is to show someone as 3.08 years, or to show the age as
"yyyy", which makes anyone under a year old to calclate as "0" years old.
This is what I have tried.

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

Age: DateDiff("m",[Birthday],Now())/12

Thanks for your help.
 
D

Dirk Goldgar

Stacy said:
Is there an easy way to show that Sally is 2 years and 4 months old?
My best attempt so far is to show someone as 3.08 years, or to show
the age as "yyyy", which makes anyone under a year old to calclate
as "0" years old. This is what I have tried.

DateDiff("yyyy",[Birthday],Date())+(Format([Birthday],"mmdd")>Format(Dat
e(
),"mmdd"))

Age: DateDiff("m",[Birthday],Now())/12

Thanks for your help.

In addition to the link Wayne posted, you might have a look at this one,
which returns the result as a string:

http://www.accessmvp.com/DJSteele/Diff2Dates.html
 
J

Jeff Conrad

in message:
Is there an easy way to show that Sally is 2 years and 4 months old? My best
attempt so far is to show someone as 3.08 years, or to show the age as
"yyyy", which makes anyone under a year old to calclate as "0" years old.
This is what I have tried.

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

Age: DateDiff("m",[Birthday],Now())/12

Use Doug Steele's advanced DateDiff function:

http://www.accessmvp.com/djsteele/Diff2Dates.html
 

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