Technically, When should a person add 1 year to his Age (MS Access 2010 Help)?

Home » Programming & Design » Technically, When should a person add 1 year to his Age (MS Access 2010 Help)?
Programming & Design No Comments

So I was making a database in MS Access and putting Date of Births and Date of Marriages. Then I tried creating a calculated field Age Upon Marriage.

What I noticed was that the field would return x-1+.99 as the Age of the Person if the Date of Marriage is his/her birthday. For example the Person was born January

So I was making a database in MS Access and putting Date of Births and Date of Marriages. Then I tried creating a calculated field Age Upon Marriage.

What I noticed was that the field would return x-1+.99 as the Age of the Person if the Date of Marriage is his/her birthday. For example the Person was born January 2, 2001 and he got married on January 2, 2031, The answer should be 30. But the computer returns 29.99. And so when it gets rounded down, it becomes 29

If I don't input the round down field and just use the [DateofMarriage]-[DateofBirth], the computer would round up the ages. Example Date of Birth is September 9, 1943 and Date of Marriage is May 21, 1944, MS Access returns 1.

My questions are:
1) Is my ms access formula wrong? If yes, how do i fix it? What formula should i put in?

The formula I used is Date of Marriage – Date of Birth.

Then I created another field and put an expression Left([AgeUponMarriage],2)
to round down the Age to the nearest Year.

Other answer:

?:
Maybe it's the way it tries to calculate leap years. Or the difference between ordinal and cardinal numbers.
joe:
When do you think? If you are old enough to ask this question, then you already know the answer! When are you old enough to drive? When are you old enough to drink? If you know these answers then you should no have asked this dumb question!
EddieJ:
Do you know how to create a function in a VBA module?

https://msdn.microsoft.com/en-us/library…

Neel:
wow-sum

LEAVE A COMMENT