calculate automatically time between two dates

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

Guest

I am very new to access and was trying to create a data field that
automatically calcuates the age of a person at death from the two previous
fields (one being the date of birth and the other the date of death). I have
very limited knowledge about this, but I am learnigng! Any suggestions would
be greatly appreciated.
 
=DateDiff("yyyy",[Birthdate],[DeathDate])+(Format([Birthdate],"mmdd")>Format
([DeathDate],"mmdd"))
 
You can use the DateAdd function to get the different between two dates, in
years, month, weeks etc, check help on the subject

DateDiff ("yyyy",startDate,EndDate) 'Will give you the difference in
years between the two dates
 
You know. The formula I posted was to calculat an age as of this moment
(using NOW()). I replaced the "now" portion with death date.

I think Ofer is correct that you simply need to use the singel Datediff that
he posted.

Disregard my post for your application.

--
Rick B



Rick B said:
=DateDiff("yyyy",[Birthdate],[DeathDate])+(Format([Birthdate],"mmdd")>Format
([DeathDate],"mmdd"))


--
Rick B



kaylor.23 said:
I am very new to access and was trying to create a data field that
automatically calcuates the age of a person at death from the two previous
fields (one being the date of birth and the other the date of death). I have
very limited knowledge about this, but I am learnigng! Any suggestions would
be greatly appreciated.
 
Back
Top