Change the Format of a Date Field in a Word Mail Merge Using Switches

by Avantix Learning Team | Updated April 6, 2021

Applies to: Microsoft® Word® 2010, 2013, 2016, 2019 and 365 (Windows)

You can change the format of a date field in a Microsoft Word mail merge document using switches in field codes. Typically, date formatting problems occur when the source document for the mail merge is an Excel workbook or Access database. Mail merge date fields can only be changed using switches. A date switch is a field code that changes the format of a date field (such as mm/dd/yy).

A date field in a Word mail merge is typically inserted in the main document using Insert Merge Field on the Mailings tab in the Ribbon.

Related article: How to Use Mail Merge in Microsoft Word to Generate Form Letters

Using codes in a date field switch

The common codes used in a date switch are d for day, M for month (this must be entered as a capital M as m is used for minutes) and y for year as follows:

d = one or two-digit day

dd = two-digit day

ddd = abbreviated day name

dddd = full day name

M = one or two-digit month

MM = two-digit month

MMM = abbreviated month name

MMMM = full month name

yy = two-digit year

yyyy = four-digit year

Date switches start with \@ and the codes that follow must be entered in quotes or double quotes. Field codes are enclosed in curly brackets.

The syntax of the full mail merge date field code with the switch is:

{MERGEFIELD FieldName \@ "datecodes"}

Changing the format of Word mail merge date field using a switch

To use a switch to change the format of a mail merge date field in Word, you will first need to display the field code and then type the switch starting with \@:

  1. In the main Word mail merge document, select the date field.
  2. Right-click the field and choose Toggle Field Codes from the drop-down menu to display the field code. You can also press Shift + F9 to display the field code.
  3. If necessary, delete \*MERGEFORMAT from the field code.
  4. Enter the switch after the field name (such as \@ "MMMM d/yy"). Be sure to type a space after \@.
  5. Right-click the field and choose Toggle Field Codes from the drop-down menu to hide the field code. You can also press Shift + F9 to hide the field code.
  6. Right-click in the field and select Update Field from the drop-down menu. You can also press F9 to update the field.
  7. Run the merge by selecting Edit Individual documents from the Mailings tab in the Ribbon and then click OK in the dialog box. In the merged document, the date should appear in the switch format.

Date field formatting examples

The following are examples of mail merge date fields formatted using switches.

To change the date field formatting to a format to display the year, month and day (such as 2020-12-28), we used the following switch:

{MERGEFIELD RegistrationDate \@ "yyyy-MM-dd"}

To change the date field formatting to display the full  month name and 4-digit year (such as December 2020), we used the following switch:

{MERGEFIELD RegistrationDate \@ "MMMM yyyy"}

To change the date field formatting to display the full month name, one or two-digit day and four-digit year (such as December 28, 2020), we used the following switch:

{MERGEFIELD RegistrationDate \@ "MMMM d, yyyy"}

The name of the date merge field in the above examples comes from the Excel source file. The curly brackets cannot be typed.

Subscribe to get more articles like this one

Did you find this article helpful? If you would like to receive new articles, join our email list.

More resources

How to Create a Table of Contents in Word

How to Insert a Watermark in Word (like DRAFT)

How to Remove Hard Returns in Word Documents

How to Find and Replace in Word (and use Wildcards)

How to Superscipt or Subscript in Word (with Shortcuts)

Related courses

Microsoft Word: Intermediate / Advanced

Microsoft Word: Designing Dynamic Word Documents Using Fields

Microsoft Word: Long Documents Master Class

Microsoft Word: Accessible Word Documents

Microsoft Excel: Intermediate / Advanced

Microsoft PowerPoint: Intermediate / Advanced

VIEW MORE COURSES >

Our instructor-led courses are delivered in virtual classroom format or at our downtown Toronto location at 18 King Street East, Suite 1400, Toronto, Ontario, Canada (some in-person classroom courses may also be delivered at an alternate downtown Toronto location). Contact us at info@avantixlearning.ca if you'd like to arrange custom instructor-led virtual classroom or onsite training on a date that's convenient for you.

Copyright 2022 Avantix® Learning

You may also like

How to View Document Statistics in Microsoft Word

How to View Document Statistics in Microsoft Word

Microsoft Word automatically tracks statistics about your documents. These statistics appear in Word Properties and include the file name, directory, template, author, editing time, last print date and the user who last modified the document.

How to Create a Table Template in Word

How to Create a Table Template in Word

If you insert tables frequently in Word, you may want to create a table template to save time. Keep in mind that tables are affected by themes, styles and table styles so if the table template you insert seems to change formatting, the current document may contain different formatting from the original document when the table template was saved. A table template is saved as a building block and will appear in Quick Tables.

How to Delete a Page in Word (Remove Blank or Extra Pages)

How to Delete a Page in Word (Remove Blank or Extra Pages)

In Word, you can delete a page in the middle or at the end of a document using several strategies. You can delete blank pages or pages that contain text and other content. Blank pages can be caused by unnecessary hard returns (pressing Enter too many times), manual page breaks, section breaks, paragraph formatting and tables so you will need to determine what is causing a blank page to remove it.

Microsoft, the Microsoft logo, Microsoft Office and related Microsoft applications and logos are registered trademarks of Microsoft Corporation in Canada, US and other countries. All other trademarks are the property of the registered owners.

Avantix Learning |18 King Street East, Suite 1400, Toronto, Ontario, Canada M5C 1C4 | Contact us at info@avantixlearning.ca

Summary
How to Change the Date Format of a Date Field in a Word Mail Merge
Article Name
How to Change the Date Format of a Date Field in a Word Mail Merge
Description
You can change the format of a date field in a Microsoft Word mail merge document using switches in field codes. Typically, date formatting problems occur when the source document for the mail merge is an Excel workbook or Access database. Mail merge date fields can only be changed using switches. A date switch is a field code that changes the format of a date field (such as mm/dd/yy).
Author
Publisher Name
Avantix Learning

Pin It on Pinterest

Share This