Field code for previous month

B

Brad

Hi all,

I get the impression that this should be really simple but it feels
like I've been banging my head against a brick wall for ages.

I'm running Word 97 on NT4 and the help files says that I can get the
previous month by using the field code -

{ QUOTE { IF { DATE \@ "M" } = 1 "12" " {= { DATE \@ "M" } -1 } "
}/1/95 \@ "MMMM" }

but I keep getting this error message "Error! Too many picture
switches defined." I can't find the error message anywhere in the
help files and I've tried changing the above but to no avail.

Is this a bug in Word 97 or am I just being stupid.

Thanks in advance for any gracious assistance.

Brad
 
G

Geoffrey Oakes

Brad:

I tried your field code on my Word 97 / NT 4 system and it worked correctly.

Then I entered the { QUOTE } field by using Insert->Field, but deliberately
made an error by entering the contents ({ IF { DATE \@ "M" } = 1 "12" " {=
{ DATE \@ "M" } -1 } " }/1/95 \@ "MMMM") as text rather than by inserting
the IF, DATE and = fields. This resulted in the same message you are
seeing - "Error! Too many picture switches defined.".

Hope this helps,
Geoff
 
M

macropod

Or, even simpler:
{QUOTE{=MOD({DATE \@ "MM"}-2,12)+1}/00 \@ MMMM}
Only 3 nested fields!
Cheers
PS: Remove NO.SPAM from the above before replying.
 

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