Eugénio Varejão wrote:
I'm using OO Writer to write a contract between a person and an institution. I want calculate in text the age of the individual: I have a the born date and the present day. How can do this?

Insert > Fields > Other > Variables > Set variable
  Name: Birth_date
  Value: 1/1/1950
  Format: (Additional formats > Date > [pick one])

Insert > Fields > Other > Variables > Set variable
  Name: Document_date
  Value: 3/5/2007
  Format: (Additional formats > Date > [pick one])

Insert > Fields > Other > Variables > Formula
  Value: Document_date - Birth_date
  Format: General (default)

This will show the person's age in days. This is because the date variables store the date as an integer number of days since December 30, 1899.

So, to see the age in years, change the formula field to

  (Document_date - Birth_date)/365.25

If you want to show an integer number of years, choose a number format like "1234" (no decimal part), but be aware that this _rounds_ to the nearest year, which may not be acceptable. We normally don't count a person as one year older until their birthday is past.

<Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to