Calculate age at future date from DOB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to be able to calculate a woman's age at the time of her baby's birth,
based on the dates recorded in her DOB and EDD (estimated date of delivery)
fields (i.e. calculate her "Age @ EDD"). Can anyone help me out? Many
thanks!
 
To calculate the age at any particular date, try:

DateDiff("yyyy", [DOB], [EDD]) - _
IIf(Format([EDD], "mmdd") < Format([DOB], "mmdd")), 1, 0)
 
I love ya, Doug--it worked with only very minor tweaking!!
=DateDiff("yyyy",[DOB],[EDD])-IIf(Format([EDD],"mmdd")<Format([DOB],"mmdd"),1,0)
Many thanks!

Douglas J. Steele said:
To calculate the age at any particular date, try:

DateDiff("yyyy", [DOB], [EDD]) - _
IIf(Format([EDD], "mmdd") < Format([DOB], "mmdd")), 1, 0)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Guate said:
I need to be able to calculate a woman's age at the time of her baby's
birth,
based on the dates recorded in her DOB and EDD (estimated date of
delivery)
fields (i.e. calculate her "Age @ EDD"). Can anyone help me out? Many
thanks!
 
I'm trying to calculate the age at future date (2002) from DOB in acces.
the DOB name is Driver DOB and is like this mm/dd/yyyy. For example convert
this 01/01/56 to 2002 (begining of 2002)
thanks

Douglas J. Steele said:
To calculate the age at any particular date, try:

DateDiff("yyyy", [DOB], [EDD]) - _
IIf(Format([EDD], "mmdd") < Format([DOB], "mmdd")), 1, 0)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Guate said:
I need to be able to calculate a woman's age at the time of her baby's
birth,
based on the dates recorded in her DOB and EDD (estimated date of
delivery)
fields (i.e. calculate her "Age @ EDD"). Can anyone help me out? Many
thanks!
 
See:
http://allenbrowne.com/func-08.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Papa said:
I'm trying to calculate the age at future date (2002) from DOB in acces.
the DOB name is Driver DOB and is like this mm/dd/yyyy. For example
convert
this 01/01/56 to 2002 (begining of 2002)
thanks

Douglas J. Steele said:
To calculate the age at any particular date, try:

DateDiff("yyyy", [DOB], [EDD]) - _
IIf(Format([EDD], "mmdd") < Format([DOB], "mmdd")), 1, 0)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Guate said:
I need to be able to calculate a woman's age at the time of her baby's
birth,
based on the dates recorded in her DOB and EDD (estimated date of
delivery)
fields (i.e. calculate her "Age @ EDD"). Can anyone help me out? Many
thanks!
 
it didn't work, there is mistake somewhere. What I did, was:
=DateDiff("yyyy", [Driver DOB], [2002]) - IIf(Format([2002], "mmdd") <
Format([Driver DOB], "mmdd")), 1, 0) and ran it
thanks

Papa said:
I'm trying to calculate the age at future date (2002) from DOB in acces.
the DOB name is Driver DOB and is like this mm/dd/yyyy. For example convert
this 01/01/56 to 2002 (begining of 2002)
thanks

Douglas J. Steele said:
To calculate the age at any particular date, try:

DateDiff("yyyy", [DOB], [EDD]) - _
IIf(Format([EDD], "mmdd") < Format([DOB], "mmdd")), 1, 0)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Guate said:
I need to be able to calculate a woman's age at the time of her baby's
birth,
based on the dates recorded in her DOB and EDD (estimated date of
delivery)
fields (i.e. calculate her "Age @ EDD"). Can anyone help me out? Many
thanks!
 
What is [2002]: a field in your table, a control on your form, or are you
trying to use the constant 2002?

2002 isn't a date... If you're trying to see what their age was on, say,
January 1st, 2002, you'll need to use

=DateDiff("yyyy", [Driver DOB], #01/01/2002#) - IIf("0101" < Format([Driver
DOB], "mmdd"), 1, 0)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Papa said:
it didn't work, there is mistake somewhere. What I did, was:
=DateDiff("yyyy", [Driver DOB], [2002]) - IIf(Format([2002], "mmdd") <
Format([Driver DOB], "mmdd")), 1, 0) and ran it
thanks

Papa said:
I'm trying to calculate the age at future date (2002) from DOB in acces.
the DOB name is Driver DOB and is like this mm/dd/yyyy. For example
convert
this 01/01/56 to 2002 (begining of 2002)
thanks

Douglas J. Steele said:
To calculate the age at any particular date, try:

DateDiff("yyyy", [DOB], [EDD]) - _
IIf(Format([EDD], "mmdd") < Format([DOB], "mmdd")), 1, 0)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I need to be able to calculate a woman's age at the time of her baby's
birth,
based on the dates recorded in her DOB and EDD (estimated date of
delivery)
fields (i.e. calculate her "Age @ EDD"). Can anyone help me out?
Many
thanks!
 
I still didn't get anything. Do I have to change something in the formula? I
just copy and paste it.let me explain again. the first column is year all in
2002 and the other column is Driver DOB (for example, 01/15/1956).
=DateDiff("yyyy", [Driver DOB], #01/01/2002#) - IIf("0101" < Format([Driver
DOB], "mmdd"), 1, 0)
thanks

Douglas J. Steele said:
What is [2002]: a field in your table, a control on your form, or are you
trying to use the constant 2002?

2002 isn't a date... If you're trying to see what their age was on, say,
January 1st, 2002, you'll need to use

=DateDiff("yyyy", [Driver DOB], #01/01/2002#) - IIf("0101" < Format([Driver
DOB], "mmdd"), 1, 0)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Papa said:
it didn't work, there is mistake somewhere. What I did, was:
=DateDiff("yyyy", [Driver DOB], [2002]) - IIf(Format([2002], "mmdd") <
Format([Driver DOB], "mmdd")), 1, 0) and ran it
thanks

Papa said:
I'm trying to calculate the age at future date (2002) from DOB in acces.
the DOB name is Driver DOB and is like this mm/dd/yyyy. For example
convert
this 01/01/56 to 2002 (begining of 2002)
thanks

:

To calculate the age at any particular date, try:

DateDiff("yyyy", [DOB], [EDD]) - _
IIf(Format([EDD], "mmdd") < Format([DOB], "mmdd")), 1, 0)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I need to be able to calculate a woman's age at the time of her baby's
birth,
based on the dates recorded in her DOB and EDD (estimated date of
delivery)
fields (i.e. calculate her "Age @ EDD"). Can anyone help me out?
Many
thanks!
 
What happens when you try it? Do you get an error message? If so, what is
it? Where are you trying to use the formula?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Papa said:
I still didn't get anything. Do I have to change something in the formula?
I
just copy and paste it.let me explain again. the first column is year all
in
2002 and the other column is Driver DOB (for example, 01/15/1956).
=DateDiff("yyyy", [Driver DOB], #01/01/2002#) - IIf("0101" <
Format([Driver
DOB], "mmdd"), 1, 0)
thanks

Douglas J. Steele said:
What is [2002]: a field in your table, a control on your form, or are you
trying to use the constant 2002?

2002 isn't a date... If you're trying to see what their age was on, say,
January 1st, 2002, you'll need to use

=DateDiff("yyyy", [Driver DOB], #01/01/2002#) - IIf("0101" <
Format([Driver
DOB], "mmdd"), 1, 0)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Papa said:
it didn't work, there is mistake somewhere. What I did, was:
=DateDiff("yyyy", [Driver DOB], [2002]) - IIf(Format([2002], "mmdd") <
Format([Driver DOB], "mmdd")), 1, 0) and ran it
thanks

:

I'm trying to calculate the age at future date (2002) from DOB in
acces.
the DOB name is Driver DOB and is like this mm/dd/yyyy. For example
convert
this 01/01/56 to 2002 (begining of 2002)
thanks

:

To calculate the age at any particular date, try:

DateDiff("yyyy", [DOB], [EDD]) - _
IIf(Format([EDD], "mmdd") < Format([DOB], "mmdd")), 1, 0)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I need to be able to calculate a woman's age at the time of her
baby's
birth,
based on the dates recorded in her DOB and EDD (estimated date of
delivery)
fields (i.e. calculate her "Age @ EDD"). Can anyone help me out?
Many
thanks!
 
Back
Top