Hi!
I am not a programmer so please ... don't be too rough on me!
In an MS Word (vintage 2010) document I need to calculate age in years from a birthdate and a chosen date.
I've done a lot of searching and hope this can work:
https://answers.microsoft.com/en-us...age-from/1f3b99d1-330e-4b2f-b3d2-77fcd39d5048
{QUOTE{SET by {BirthDate \@ yyyy}}
{SET bm {BirthDate \@ M}}
{SET bd {BirthDate \@ d}}
{SET yy {DATE \@ yyyy}}
{SET mm {DATE \@ M}}
{SET dd {DATE \@ d}}
{Set Years{=yy-by-(mm<bm)-(mm=bm)*(dd<bd) \# 0}}
Ultimate goal: to be able to click on a dropdown calendar field(not sure if this is the correct word to use!) to choose the BirthDate,
then use another dropdown calandar field(?) to enter a DATE, then have MS Word calculate the age in years between those two dates,
and only display the age in years (not the BirthDate nor the DATE) in the final document.
My problem is that the above code seems to refer to field code(s) and I have no idea how to work with them. Above my pay grade!
But I can follow directions
Please lend a guiding hand with step-by-step instructions for how to use the above code to calculate the age in years from a birthdate and another date.
If the above code is not the "right stuff" please advise what I should use.
Thanks so much!
I am not a programmer so please ... don't be too rough on me!
In an MS Word (vintage 2010) document I need to calculate age in years from a birthdate and a chosen date.
I've done a lot of searching and hope this can work:
https://answers.microsoft.com/en-us...age-from/1f3b99d1-330e-4b2f-b3d2-77fcd39d5048
{QUOTE{SET by {BirthDate \@ yyyy}}
{SET bm {BirthDate \@ M}}
{SET bd {BirthDate \@ d}}
{SET yy {DATE \@ yyyy}}
{SET mm {DATE \@ M}}
{SET dd {DATE \@ d}}
{Set Years{=yy-by-(mm<bm)-(mm=bm)*(dd<bd) \# 0}}
Ultimate goal: to be able to click on a dropdown calendar field(not sure if this is the correct word to use!) to choose the BirthDate,
then use another dropdown calandar field(?) to enter a DATE, then have MS Word calculate the age in years between those two dates,
and only display the age in years (not the BirthDate nor the DATE) in the final document.
My problem is that the above code seems to refer to field code(s) and I have no idea how to work with them. Above my pay grade!
But I can follow directions
Please lend a guiding hand with step-by-step instructions for how to use the above code to calculate the age in years from a birthdate and another date.
If the above code is not the "right stuff" please advise what I should use.
Thanks so much!