J
Jennifer K.
I have the following expressions:
GBIRTH: IIf([GDOB]=99 Or [GMOB]=99 Or
[GYOB]=9999,Null,DateSerial([GYOB],[GMOB],[GDOB]))
MDATE: IIf([DOO]=99 Or [MOO]=99 Or
[YOO]=9999,Null,DateSerial([YOO],[MOO],[DOO]))
MAGE:
DateDiff("yyyy",[GBIRTH],[MDATE])-IIf(Format([GBIRTH],"mmdd")>Format([MDATE],"mmdd"),1,0)
The first and the second expression take three separate fields representing
date "pieces" (day, month, and year) and put it into a date format.
The third expression calculates age based upon the two dates. They all work
well individually when used in a query.
I would like to combine this into one (long) expression that could ideally
be used in a form (or in a query) to calculate age once the two dates are
entered into the form. Likely, I am probably messing up a paren ( ) somewhere
but not sure.
Thanks you for your input.
Jennifer
GBIRTH: IIf([GDOB]=99 Or [GMOB]=99 Or
[GYOB]=9999,Null,DateSerial([GYOB],[GMOB],[GDOB]))
MDATE: IIf([DOO]=99 Or [MOO]=99 Or
[YOO]=9999,Null,DateSerial([YOO],[MOO],[DOO]))
MAGE:
DateDiff("yyyy",[GBIRTH],[MDATE])-IIf(Format([GBIRTH],"mmdd")>Format([MDATE],"mmdd"),1,0)
The first and the second expression take three separate fields representing
date "pieces" (day, month, and year) and put it into a date format.
The third expression calculates age based upon the two dates. They all work
well individually when used in a query.
I would like to combine this into one (long) expression that could ideally
be used in a form (or in a query) to calculate age once the two dates are
entered into the form. Likely, I am probably messing up a paren ( ) somewhere
but not sure.
Thanks you for your input.
Jennifer