Calculating AGE from DOB merge field

G

Greg

Gay

The following example assumes that you already have data
in a bookmark or mergefield for the following variables

PTU = Permission to Use
AA = Alternate Address
HA = Home Address
Years = Age in Years

If that is the case, I was able to make the following work:

{IF {AA} <> ""{IF{YEARS} > 17{IF {PTU} + "Yes"{AA}{HA}}
{HA}}{HA}}
 
G

Greg Maxey

Gay,

A calculated date field IMO is brutally complicated, but it can be achieved.
If you are content with years only and not concerned with months and days,
then I think that you could get by with:

{Set Years{={Date\@ yyyy}-{MergeField DOB \@ yyyy }-({Date \@
MMM}<{MergeField DOB \@ MMM})-({Date \@ MMM}={MergeField DOB \@ MMM})*({Date
\@ d}<{MergeField DOB \@ d})}}

This will SET a bookmark name Years to the value of age in years.
 
D

Doug Robbins

You can use a formatting switch to return just the year from a date.

See "Formatting Word fields with switches" on fellow MVP Graham Mayor's
website at

http://www.gmayor.com/formatting_word_fields.htm

But if your data source is Excel or Access, you are better off to do the
data manipulation there.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top