Re: How to calculate a person's age?
Posted in 1997
Melvin, Have you tried this age=extend(current,year to month)-extend(birthday,year to month) this however will not be 100% accurate because of the day of the month but an if statement checking for the day will take care of that. Joe ------------------------------------------------------------------------- Joseph Cullipher |E-mail: joseph@cannonexpress.com PO Box 364 |opinions express are those of my own and Springdale, AR 72764 USA |don't necessarily reflect those of my company ------------------------------------------------------------------------- On Fri, 5 Sep 1997, Ing. Melvin Perez Cedano wrote: } Hi all: } } I trying to calculate how old are a person. I have the birth date in a } column. I have been using a DATETIME YEAR TO YEAR variable in my program } and asigning to it the result of (TODAY - birthdate) UNITS YEAR it } returns NULL. } } I have done using an INTEGER variable without UNITS clause and it } returns the number of days. I know I could divide this number between } 365/366 and get the number of years, but I would like to get more } presision. } } How have you done this? } } -- } ////// } +---------------------------ooo-O-O-ooo--------------------------------+ } | U | } | Melvin Perez Cedano Santo Domingo, Dom. Rep.| } | Vice-President cam@codetel.net.do | } | Systems Development Phone (809) 686-5574 | } | CAM Informatica, S. A. Fax (809) 686-5467 | } +----------------------------------------------------------------------+ } | ALL RIGHTS RESERVED | } | This posting is copyright and may be used only for the purposes | } | of professional study or the professional exchange of information. | } | Use of this posting by any commercial organisation for the | } | purposes of vilifying another is explicitly prohibited. | } +----------------------------------------------------------------------+ }