calculating exact age and workingyears

Kenneth Brody kenbrody at bestweb.net
Wed Nov 24 06:44:04 PST 2004


Peter Klaassen - NCC vof wrote:
> 
> For this I use in the automatic processing:
> 
> :'employmentdate is 10,DMYY/
> :'birthdate is 10,DMYY/:
> :
> :ja(6,.3);la(6,.3);jr(2,.0);lt(2,.0):
> :
> :ja=((@td-employmentdate)/"364.25");la=((@td-birthdate)/"364.25"):
> :
> :jr=ja;lt=la:
> :@td lt (mid(employmentdate,"1","6"){mid(@td,"7","4"))
> :jr=ja-"1":
> :@td lt (mid(birthdate,"1","6"){mid(@td,"7","4"))
> :lt=la-"1":
> 
> calculating total amount op days, deviding by 364.25 into an
> .3 variable, placing it in a .2 varibale concluding by checking if
> todaysdate is less than the birthdaydate.
> this however not always results in the correct figures.
> I can't trace the error I make.
[...]

Can you give a specific example of "incorrect figures"?

Also, is there a reason you do the calculation into a .3 field and then
move the result into a .2 field?

And why do you subtract 1 from the fields if today is prior to the
anniversary?

Perhaps if you can explain exactly what you are trying to calculate?

If tomorrow were my 44th birthday, what number do you want?

What if I were born on January 1st, and today was December 31st?

-- 
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody        | www.hvcomputer.com |                             |
| kenbrody/at\spamcop.net | www.fptech.com     | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap at gmail.com>




More information about the Filepro-list mailing list