Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word XP - Mail Merge change date format 2

Status
Not open for further replies.

ch4meleon

Technical User
Jan 13, 2003
60
GB
I have a mail merge letter document in word the source data for which is in excel. I need the date in a specific format (June 17, 2005)but despite the format being correct on the excel spreadsheet it comes into the merge letter as 7/17/05
Please ... how do i change it ??

 
Click on the mail merge field in the Word doc with the right mouse button and select Toggle Field codes, then edit it to read:
{MERGEFIELD "YourDate"\@ "MMMM dd, yyyy" \* MERGEFORMAT}

Then toggle again.

Don't know how you get the comma before the year, though it doesn't show on mine.
HTH
 
Hi ch4meleon,

Slightly easier than Moira's suggestion:

Click on the mail merge field and press Shift-F9 to reveal the code. The field will look something like:
{MERGEFIELD "YourDate"}
Edit it to look more like:
{MERGEFIELD "YourDate" \@ "MMMM d, yyyy"}
then press Shift-F9 to toggle the code display off before running your mail merge.

With the date format switch (\@ "MMMM d, yyyy"):
. 'yyyy' outputs the year and century (4 digits);
. 'yy' outputs the year only (2 digits, including leading 0s);
. 'MMMM' outputs the month in full;
. 'MMM' outputs the month as a 3-letter abbreviation;
. 'MM' outputs the month as 2 digits (ie with leading 0s);
. 'M' outputs the month as 1 or 2 digits (ie without leading 0s);
. don't use 'm' instead of 'M' for months - 'm' is for minutes!;
. 'dd' outputs the day as 2 digits (ie with leading 0s); and
. 'd' outputs the day as 1 or 2 digits (ie without leading 0s).

Cheers
PS: You probably don't need the \* MERGEFORMAT switch.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top