views:

154

answers:

1

I have an CV and would like to automatically update my age when opening. So, what formula should I insert in a MS Word field?

Something like:

{= {DATE} - {"01/01/1983"} }

+1  A: 

This is one of the better sites for working with Word field codes - http://www.addbalance.com/usersguide/fields.htm - and there are examples there on how to create +/- dates.

Here's how you would calculate based of a birth month of January and birth year of 1983.

{IF{DATE\@"MM"} >= 01 { = {DATE\@"YYYY"} – 1983 \#"00"} { = {DATE\@"YYYY"} – 1984 \#"00"}}

Note that in the case of the month of January, this IF statement will always be true and give you =YEAR-1983. You can use another nested IF statement to check on the day to further get more accurate.

Otaku
I saw this, however not found there an answer to my question. only Today\Create\Save date are available.
serhio
Yeah, you have do use DATE to do this calculation. Word field codes are notoriously difficult to type in and get right as even the wrong spacing will give different results. Code you need is updated in the answer.
Otaku
even `{= {DATE \@ "yyyy"} - 2` does not work... Syntax error...
serhio
@serhio: you forgot the closing bracket **}** at the end. When you enter field codes, you can't just type in the brackets though - you have to use **Ctrl+F9** to enter the brackets.
Otaku
Thanks! <kbd>Ctrl+F9</kbd> was useful.
serhio