PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → age calculation
age calculation
Débuté par guillermo, 12 oct. 2005 23:36 - 7 réponses
Posté le 12 octobre 2005 - 23:36
Hi forum:
Exist a function for age calculation ?
Thanks
Guillermo
Posté le 13 octobre 2005 - 00:01
Hi Guillermo,
Saw it announced in WD10, so not yet I guess.
Regards,
Piet
Posté le 13 octobre 2005 - 02:32
Hi Piet:
I remember to have read something in this respect, but I forgot where, I have been looking for it hours ago, without success.
Guillermo
Hi Guillermo,
Saw it announced in WD10, so not yet I guess.
Regards,
Piet
Posté le 13 octobre 2005 - 04:56
The code gave it to me a friend (the great Ernesto Del Punta ), an old calculation that comes from QBasic or maybe Clipper.
Age = ((Year_Today - Year_of_Birth) * 12 + Month_Today - Month_of_Bird )/12
IF Month_of_Bird = Month_of_Bird AND Day_Of_Birth > Day_Today THEN
Age -= 1
END

Guillermo
Hi Piet:
I remember to have read something in this respect, but I forgot where, I have been looking for it hours ago, without success.
Guillermo
Hi Guillermo,
Saw it announced in WD10, so not yet I guess.
Regards,
Piet
Posté le 13 octobre 2005 - 08:35
G'day Guillermo
There is a typo in your example. >IF Month_of_Bird = Month_of_Bird

Age = ((Year_Today - Year_of_Birth) * 12 + Month_Today - Month_of_Bird )/12
IF Month_of_Bird = Month_of_Bird AND Day_Of_Birth > Day_Today THEN
Age -= 1
END

Regards
Al
Posté le 13 octobre 2005 - 16:34
G'day Al
Corrected.
Thanks
Guillermo

G'day Guillermo
There is a typo in your example. >IF Month_of_Bird = Month_of_Bird

Age = ((Year_Today - Year_of_Birth) * 12 + Month_Today - Month_of_Bird )/12
IF Month_of_Bird = Month_of_Bird AND Day_Of_Birth > Day_Today THEN
Age -= 1
END

Regards
Al
Posté le 13 octobre 2005 - 16:53
I would be thinking of some object "flyer", since instead of BIRTH I put BIRD
Guillermo
G'day Al
Corrected.
Thanks
Guillermo

G'day Guillermo
There is a typo in your example. >IF Month_of_Bird = Month_of_Bird

Age = ((Year_Today - Year_of_Birth) * 12 + Month_Today - Month_of_Bird )/12
IF Month_of_Bird = Month_of_Bird AND Day_Of_Birth > Day_Today THEN
Age -= 1
END

Regards
Al
Posté le 14 octobre 2005 - 01:28
Hi forum:
Exist a function for age calculation ?
Thanks
Guillermo

Hi Guillermo,
Age calculation:
FUNCTION Age(pdBirthDate is Date)
ldToday is Date = DateSys()
RESULT ldToday..Year - pdBirthDate..Year - (ldToday..Month < pdBirthDate..Month ? 1 ELSE 0)
Greetings,
Xavier
Founder of the WinDev Developers Group Belgium & The Netherlands

WinDev Developers Group Belgium-Netherlands