Share via

Compare date in IF statement

Anonymous
2012-01-02T17:23:59+00:00

I have a Word document that merges with policy data. I need to compare the line of business and the effective date (if greater or equal to January 1, 2012), then insert a Word document. I'm stuck! Thanks for your assistance. PMS

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Paul Edstein 82,861 Reputation points Volunteer Moderator
2012-01-02T22:40:48+00:00

Hi Paula,

Your IF test should look something like:

{IF{MERGEFIELD Line_of_Business_Date @ YYYYMMDD} < {Date @ YYYYMMDD}  "" {INCLUDETEXT "Filepath & name"}}

or:

{IF{MERGEFIELD Line_of_Business_Date @ YYYYMMDD} < 20120101  "" {INCLUDETEXT "Filepath & name"}}

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message.

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-01-03T17:24:53+00:00

    Yep, that's what I did. I was looking at it too long! Needed to walk away for a bit. Thanks for the reply.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-01-02T19:31:50+00:00

    Should have waited a few hours. I now have it working.

    Was this answer helpful?

    0 comments No comments