View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default How do I compare later/earlier dates in a mail merge IF field?

Use

{ IF { MERGEFIELD Date_Of_Birth \@ "yyyyMMdd" } 19760701 "Text1" "Text2" }

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis

Doug Robbins - Word MVP

"AdamT" wrote in message
news
I'm trying to create an IF field in a mail merge to display one of two
paragraphs depending on whether the Date of Birth field in a record is
after
a certain time. I've tried using:

{ IF { MERGEFIELD Date_Of_Birth } 01/07/1976 "Text1" "Text2" }

(The date format above is UK, i.e. dd/MM/yyyy)

...but Word always seems to treat the date as a number, and so any date
later than the first of a month counts as a positive, irrespective of
month
or year.