Rabu, 20 Maret 2024

[MSAccessProfessionals] Date Calculation not giving corrct age

Hello lovely people! It's a long time since I've been on here but I need your help.
I have this code to calculate and display a person's age when they passed away but it's giving me the wrong age, it adds one year to their age!

I read somewhere that it could have something to with Leap Years, but my old brain can't work it out.
Your help would be appreciated.
Thank you.

The person was born on: 4th Oct. 1923
and passed away on: 25th May 2021
Her age should have been 97 years and 7 months
NOT 98 years and 7 months
=DateDiff("yyyy",Nz([Death_Ann],Date()),Date())+(Date()<DateSerial(Year(Date()),Month(Nz([Death_Ann],Date())),Day(Nz([Death_Ann],Date())))) & " Years, " & (DateDiff("m",Nz([Death_Ann],Date()),Date())) Mod 12 & " Months Ago"


_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116608) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Tidak ada komentar:

Posting Komentar