Full Version: Date Question.
UtterAccess Forums > Microsoft® Access > Access Forms
Trying to figure this out
DateOfBirth til DateOfDeath = Aged
Using this for living age, trying to figure out what to squeeze in there to get this to work and stop counting years.
Any help is greatly appreciated..
This age calculation code is inthe archives.
On order to make this flexible for both start date (e.g., any DOB) and end date (e.g., Date of Death), I would wrap this in a function.
Public Function fAgeAtDate(dtStartDate As Date, dtAtDate As Date) As Integer
fAgeAtDate = DateDiff("yyyy", dtStartDate, dtAtDate) + (DateSerial(Year(dtAtDate), Month(dtStartDate), Day(dtStartDate)) >= dtAtDate)
End Function
Thanks George,
Ok, thanks again
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.