# Word Mail Merge Date Filter



## Ozzie2842 (Feb 27, 2015)

Hi Kids,

I'm looking for the Microsoft Word 2007 code for the current date.  For example, in Excel I use "Today()".  In a mail merge document (connected to Excel 2007 spreadsheet) where I'm trying to filter records where the field "date eligible" is greater than or equal to the current date.  I'm hoping somebody out there knows the field code for this.  Thanks in advance for looking into this.

Ozzie


----------



## Macropod (Jun 7, 2015)

Word has its own DATE field. For a mailmerge filter to exclude records before the current date, you'd encode an SKIPIF field along the lines of:
{SKIPIF{MERGEFIELD EligibleDate \@ YYYYMMDD}< {DATE \@ YYYYMMDD}}
where 'EligibleDate' is your data field's name.

*Note:* The field brace pairs (i.e. '{ }') for the above example are created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practicable to add them via any of the standard Word dialogues.


----------



## Ozzie2842 (Jun 8, 2015)

You rock Paul, thanks for your help on this


----------

