I've search and found several threads on this, but none seemed to fit with what I'm doing. I'm updating a database created by a guy who retired 6+ years ago. His formula for determining the person's age using today's date and the person's date of birth adds a year most every time. I've created a temporay patch, but I'm afraid it's not full proof so would love some input.
On a form, we enter a person's DOB (date of birth). A report is run which has a query with relationships as its control source. In that query, there are these functions, among other control sources:
The work around I made is below (changes in 3rd line)
Is there osmething standing out here as just a simple math error to make it add a year to peoples' age? Maybe if they've laready had a birthday this year or something? TIA!!
On a form, we enter a person's DOB (date of birth). A report is run which has a query with relationships as its control source. In that query, there are these functions, among other control sources:
Code:
AgeDays: Now()-[DOB]
AgeInMonths: [AgeDays]/30.4375
AgeYears: IIf([AgeInMonths]<12,0,[AgeInMonths/12)
AgeMonths: IIf([AgeInMonths]>12,[AgeInMonths] Mod 12,[AgeInMonths])
The work around I made is below (changes in 3rd line)
Code:
AgeDays: Now()-[DOB]
AgeInMonths: [AgeDays]/30.4375
AgeYears: IIf([AgeInMonths]<12,0,(([AgeInMonths/12)-1))
AgeMonths: IIf([AgeInMonths]>12,[AgeInMonths] Mod 12,[AgeInMonths])
Is there osmething standing out here as just a simple math error to make it add a year to peoples' age? Maybe if they've laready had a birthday this year or something? TIA!!