{If } doesn't work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a date field which inserts the CreateDate or where
applicable the SaveDate. This is to avoid having new docs from templates
opening with zeros and 'x's prior to saving, which happens if there's a
savedate.

I have put this into a field but it will not work.

{ IF { SAVEDATE } > { CREATEDATE } { SAVEDATE /@ "ddMMMMyyyy" } {CREATEDATE
/@ "ddMMMMyyyy" } }

Using Office 2007 and Vista.

Thanks!
 
Try this:

{ IF { SAVEDATE \# "0" } = 0 "{ CREATEDATE /@ "ddMMMMyyyy" }" "{ SAVEDATE
/@ "ddMMMMyyyy" }" }
 
It might work better with the slashes the right way round? ;)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Thank you both. Graham's code returns "SAVEDATE" while Stefan's (with the
right switches) returns 'Error! Too many picture switches defined'
 
Thank you both. Graham's code returns "SAVEDATE" while Stefan's (with the
right switches) returns 'Error! Too many picture switches defined'
 
In the code I suggested, did you remember the quotation marks? Did you
put spaces between the first SAVEDATE field and the equal sign? If you
still can't get it to work, try using \@ "M" instead of \# "0":

{ IF { SAVEDATE \@ "M" } = 0 "{ CREATEDATE \@ "ddMMMMyyyy" }" "{
SAVEDATE \@ "ddMMMMyyyy" }" }

--
Stefan Blom
Microsoft Word MVP


in message
 
Back
Top