How do I get the year before the savedate of a document?

O

OverdooZ

I have got this document that I have to print every year and I want to
automize it.

So, I am creating a template with all things that are nearly the same for
each year. This includes the year it was saved in the header (no problem
there, SaveDate \@YYYY does the trick) but I also need the year before that.
This is my problem, I cannot do any calculations on the SaveDate it seems or
if I can, I must be doing it all wrong.

Can somebody help me out?
 
J

Jay Freedman

OverdooZ said:
I have got this document that I have to print every year and I want to
automize it.

So, I am creating a template with all things that are nearly the same
for each year. This includes the year it was saved in the header (no
problem there, SaveDate \@YYYY does the trick) but I also need the
year before that. This is my problem, I cannot do any calculations on
the SaveDate it seems or if I can, I must be doing it all wrong.

Can somebody help me out?

Try nesting the SaveDate field inside a formula field like this:
{ = {SaveDate \@YYYY} - 1 }

To do this, type the = before the SaveDate field and the - 1 after it, then
select the whole thing and press Ctrl+F9.
 
O

overdoos

Thanks for trying to help me out, however it did not work because it gives me
a syntax error on the '{' that is before the savedate.

Maybe it will help a bit if I mention that I'm running a version of MS Word
2002 SP1 on Windows XP SP1

I'm thankful for every idea that might help get underway.
 
J

Jay Freedman

Both sets of braces in the field have to be field delimiters inserted with
Ctrl+F9 (or through the Insert > Field dialog), not typed { } characters. I
assumed that you already had a working SaveDate field in place.
 
D

Doug Robbins

Was that { entered from the keyboard or by using Ctrl+F9. You must enter
all field delimiters by using Ctrl+F9.

If you do that, it will work, regardless of the version of Word or Windows.

--
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
 
O

OverdooZ

Thank you both for the answer. I feel soooo stupid now ;)

I had indeed a working SaveDate, but had been messing with it to get the
previous year working and forgot to put it back to the 'pure' formatted
savedate before I tried your solution.

Anyway, it works like a charm now.

thanks
 

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