>greetings to all
>
>i need the code for calculating the age as follows:
>i habe a field where we input the date.
>i need to calculate the age on another field based on the current date
>
Here is a one liner...
ldMdate is the date of which you determine the age
ldDob is the date of birth
age = iff((month(ldMdate)*100 + day(ldMdate)) >= (month(ldDob)*100 + day(ldDob)),year(ldMdate) - year(ldDob),year(ldMdate) - year(ldDob) - 1))
With this method, you don't rely on estimating the length of a year and it will give the age in terms of the common usuage.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only