CAPTAIN INFINITY -
No need to apologize for "hacking" my code. If it is something you are able to use, I am delighted.
If not @isblank(Birthdate) then
Age = @YEAR(@DATE)-@YEAR(BirthDate) - ((@MONTH(@DATE) < @MONTH(BirthDate))
or (@MONTH(@DATE) = @MONTH(BirthDate) AND @DOM(@DATE) < @DOM(BirthDate)))
To tell you the truth, I obtained this code from Symantec Technical Support (when there was such a thing) for use in Q&A about what - 20 years ago? lol ... and it works like a charm in Sesame.
As best I can recall the only time I had a problem with "earlier" code I had created was if it was the same date (day of month) as the birthday. In other words the age would calculate properly if you checked it either a day before (or earlier) or a day after (or later) than the actual birthdate. But, if it was on the actual birthdate it would be off by one year.
This programming was designed to fix that. When it was provided, I understood it perfectly. Now I only understand it in theory and am not able to disect it without an extraordinary amount of effort.
The way it is written, it incorporates ("unseen" in the code) if/then conditions.
But I do offer you this. Here's a way to test it. I just went to my birthdate field - today - December 30, 2005.
If I enter a birthdate of December 31, 2000, the age is shown as 4 (because indeed the person is a day shy of being 5 years old)
If I enter a birthdate of December 30, 2000, the age is shown as 5 (because indeed, today is the day the person reached age 5)
If I enter a birthdate of December 29, 2000, the age is shown as 5 (because indeed the person has passed reaching the age of 5)
So I have checked the date of birth as being (1) a day (or more) before the actual birthdate, (2) on the actual birthdate or (3) a day (or more) after the actual birthdate - and it calculates correctly. I cannot think of a single "example" that would "slip through" the programming, except that:
I DO NOT know whether this works correctly for someone born on February 29th of a leap year; however, I never had a single instance where I needed to calculate based on February 29 and if needed, it should be easy enough to modify the programming for that particular date.
I know that I did not answer your question precisely but hope that the information I did provide will help you.
If it does not then please be specific about what you want to do.
I have numerous other (old Q&A) programming statements that do "math" calculations based on a date (of birth, anniversary, fixed date, etc.)
I do hope that this response will help you and wish you good luck.
By the way, just for "accuracy", I do not believe that Q&A had an @isblank function so the "lead in" was probably something like: If birthdate /= (not blank) or If birthdate <>"" (less than or greater than nothing). While that might work in Sesame, as well, it is not recommended - so Erika has told me and told me and told me ... lol